-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperators.py
More file actions
190 lines (136 loc) · 3.3 KB
/
Operators.py
File metadata and controls
190 lines (136 loc) · 3.3 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Question 1
'''a = (input("Enter a number a : "))
b = (input("Enter another number b: "))
print(a + b)
print(a - b)
print(a*b)
print(a / b)'''
#question 2
'''a = int (input("Enter a number: a"))
b = int (input("Enter a number: b"))
floor_divison = a // b
remainder = a % b
power = a ** b
print(floor_divison,remainder,power)'''
#question 3
"""pen = 15
notebook = 40
totalcost = 3*pen + 2*notebook
print(totalcost)"""
#question 4
"""a = int(input("enter a number a ="))
b = int(input("enter a number b ="))
c = int(input("enter a number c ="))
d = int(input("enter a number d ="))
e = int(input("enter a number e ="))
avg = (a+b+c+d+e)/5
print(avg)"""
#question 5
'''num = int(input("enter a number num ="))
sqr = num*num
cube = num*num*num
sqrt = num*.5
print("num :",num)
print("sqrt :",sqr)
print("cube :",cube)
print("sqrt :",sqrt)'''
#COMPARISON OPERATORS
# question 1
'''a = int(input("enter a number a ="))
b = int(input("enter a number b ="))
if(a==b):
print("a and b are equal")
else:
print("a is not equal to b")"""
# question 2
"""a = int(input("enter a number a ="))
b = int(input("enter a number b ="))
if a > b:
print("a is greater :" ,a)
else:
print("b is greater :" ,b)"""
# Question 3
"""num1 = int(input("enter a number num1 ="))
num2 = int(input("enter a number num2 ="))
num3 = int(input("enter a number num3 ="))
if num1 > num2 and num1 > num3:
print("num1 is greater :",num1)
elif num2 > num1 and num2 > num3:
print("num2 is greater :",num2)
else:
print("num3 is greater :",num3)'''
#Question 4
'''marks = int(input("enter a number marks ="))
if marks > 40 :
print("pass")
else:
print("fail")'''
# Question 5
'''age = int(input("enter a age ="))
if age >= 18:
print("Eligible to vote")
else :
print("Not eligible to vote")'''
# Question 6
'''num1 = int (input("enter a number num1 ="))
if (num1 % 2 == 0):
print("even =",num1)
else :
print("odd =",num1)'''
#question 7
'''customer = int(input("enter a number customer ="))
card = int(input("enter a number card ="))
if customer >= 1000 or card.lower == "yes":
print("eligible")
else :
print("not eligible")'''
#question 8
'''num = int(input("enter a number num ="))
if num % 3 == 0:
print("divisible")
else:
print("not divisible")'''
# question 9
'''age = int (input("enter a age ="))
if age < 19 and age > 13 :
print("teenager")
else:
print("not teenager")'''
# question 10
'''age = int(input("enter a age ="))
if age >= 18 :
print("eligible for voting and driving")
else:
print ("not eligible")'''
# Assignment Operator
# Question 1
'''x = 10
print("X", x)'''
# Question 2
'''x = int(input("Enter a number: "))
x += 5
print("X", x)'''
#Question 3
'''x = int(input("Enter a number: "))
x -= 3
print("X", x)'''
# Question 4
'''x = int(input("Enter a number "))
x *= 4
print("X", x)'''
#Question 5
'''x = float(input("Enter a number "))
x /= 2
print("X:", x)'''
# Question 6
'''x = int(input("Enter a number"))
x //= 3
print("X", x)'''
# Question 7
'''x = int(input("Enter a number"))
x %= 7
print("X", x)'''
# Question 8
'''x = int(input("Enter a number"))
x **= 3
print("X", x)'''