-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_variable.py
More file actions
83 lines (50 loc) · 1.41 KB
/
02_variable.py
File metadata and controls
83 lines (50 loc) · 1.41 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# variable mainly act as a container
# a = 30 # interger
# b = "Rishav" # string
# c = True # bool
# d = 2.22 #float
# e = None # none type of variable
# Arithmetic operators
# a = 7
# b = 4
# print("Sum is before: ",a+b)
# b+=3
# print("Sum is after: ",a+b)
# print(a>b)
# e = True or False
# print("True or False : ",e)
# typecasting
# a = 5
# b = str(a)
# print(b)
# print(type(b))
# take input
# a = int(input("Enter a number1: "))
# b = int(input("Enter a number2: "))
# print("Sum of both is : " , a + b)
# Practice Questions
# 1. Sum of two number
# a = int(input("Enter Your input: "))
# b = int(input("Enter Your input: "))
# print("sum is : ", a+b)
#2. Find remainder
# a = int(input("Enter your input: "))
# z = int(input("Enter number to find remainder: "))
# print("The remainder is: ", a%z)
# 3. check datatypes
# a = int(input("Enter any number: "))
# checkType = type(a)
# print("Your Datatypes: ", checkType)
#4. check greater
# a = 34
# b = 80
# print("B is a greater number " , b > a)
# 5. Average of numbers
# a = int(input("Enter first number: "))
# b = int(input("Enter second number: "))
# average = (a+b)/2
# print("The average of two numbers are: ",average)
# 6. Calculate the square
# a = int(input("Enter the first number: "))
# square = a*a
# print("The square of ", a ," is : ",square)