-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasics.py
More file actions
38 lines (28 loc) · 709 Bytes
/
Basics.py
File metadata and controls
38 lines (28 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## sum
# a = int(input("Enter a number: "));
# b = int(input("Enter a number: "));
# print("Sum = ", a+b);
## modulo
# n = 5;
# print(n % 2);
## check type
# a = input("Enter : ");
# t = type(a);
# print(t);
# b = int(input("Enter a number: "));
# print(type(b));
## comparison
# a = int(input("Enter a number: "));
# b = 80;
# print(a > b);
# calculate average
# a = int(input("Enter a number: "));
# b = int(input("Enter a number: "));
# print("Avg = ", (a+b)/2); # gives ans in float
## square of num
# n = int(input("Enter a number: "));
# print("Square = ", n*n); #gives ans in int only
# print("Square = ", n**2); #gives ans in int only , power operator
a = "31.2"
a = float(a)
print(type(a))