Page 128 - Trackpad_V4.0_C8_Flipbook
P. 128
5. What is the difference between the string concatenation operator and the string replication operator?
Explain with an example.
Scratch Your Brain. 21 st Century #Critical Thinking
Skills
1. Write the output of the following programs:
a. print("Hello")
print("i love"+ "python\n\n
and enjoy doing it.")
b. fruit='mango'
fruit1=fruit.upper()
print(fruit1*3)
c. car='ferrari'
print(car.upper())
print(car.lower())
print(len(car))
print(car.capitalize())
d. def total(a,b):
sum=a+b
print(sum)
total(14,16)
e. def Name(fname,lname):
full_name=fname+" "+lname
return full_name
your_name=Name("Sonia",'Mittal')
print(your_name)
2. Find errors in the codes given below and correct them.
a. print('I am Akshay Kumar')
Premium Edition-VIII
126

