Question 1
str1 = \'{2}, {1} and {0}\'.format(\'a\', \'b\', \'c\')
str2 = \'{0}{1}{0}\'.format(\'abra\', \'cad\')
print(str1, str2)
Question 2
a = 2
b = \'3.77\'
c = -8
str1 = \'{0:.4f} {0:3d} {2} {1}\'.format(a, b, c)
print(str1)
Question 3
line = \"I\'ll come by then.\"
eline = \"\"
for i in line:
eline += chr(ord(i)+3)
print(eline)
Question 4
line = \"What will have so will\"
L = line.split(\'a\')
for i in L:
print(i, end=\' \')
Question 5
import string
Line1 = \"And Then There Were None\"
Line2 = \"Famous In Love\"
Line3 = \"Famous Were The Kol And Klaus\"
Line4 = Line1 + Line2 + Line3
print(\"And\" in Line4)
Question 6
my_string = \"geeksforgeeks\"
i = \"i\"
while i in my_string:
print(i, end =\" \")
Question 7
my_string = \'geeksforgeeks\'
for i in range(my_string):
print(i)
Question 8
my_string = \'geeksforgeeks\'
for i in range(len(my_string)):
my_string[i].upper()
print (my_string)
Question 9
my_string = \'geeksforgeeks\'
for i in range(len(my_string)):
print (my_string, end=\" \")
my_string = \'a\'
Question 10
x = 123
for i in x:
print(i, end=\" \")
There are 21 questions to complete.