Python_RevisionAssignment
Python_RevisionAssignment
y = "World"
print(x, y)
print(x+y)
Output:
(b) x = 31
y=3
x = x // y
print (x)
Output:
(c) # a= 8
a=5
a=(a*2)**2 % 4 # a= 5
print(a)
Output:
1
(d) x = 19
y=x-5
y=x/5
print (y)
Output:
(e) p=5
q=3
p=p+q-2
q=p+q-2
p=p-4*5
print(p, q)
Output:
(f) num = 10
text = "Nice"
if num > 5:
if num > 10:
print(num, "is greater than 10")
elif num >=5:
print(text, "You are awesome!")
else:
print("WellDone!")
print(num,"text",text)
Output:
2
(g) x = 15
y = 10
z = 22
if x < 10:
x=y
x=z
print(x)
Output:
(h) i = 10
if (i <= 10):
if (i < 15):
print("ABC")
if (i < 10):
print("BCD")
else:
print("CDE")
if (i == 10):
print("ABC")
Output:
3
(i) x = range(1, 7)
for n in x:
print(n)
Output:
Output:
print("*",end="")
print()
Output: