You are on page 1of 2

Assignments 1:

1. Name the function/method required to

a) check if a string contains only uppercase letters


(1 marks)
b) gives the total length of the list.
(1 marks)
c) gives the range of the list.
(1 marks)
d) gives the sort on the list.
(1 marks)
2. Rewrite the following code in python after removing all syntax error(s) and write the line
number that have a syntax error.
1. def tot(Number)
1. sum=0
2. for C in Range (1, Number+1):
3. sum+=C
4. return Sum
5.
6. print(tot 3)
7. print(Tot (6))
5 marks)
3. Find and write the output of the following python code:
a.
1. for name in (['amrsubedi','Ramya','Taruna','Suraj']):
2. print (name)
3. if name[0]=='T':
4. break
5. else :
6. print('Finished')
7. print('Got it')
(5 marks)
(6
4. Write a complete program to display the time in following format. The time should
start from 00:00:00 and end at 23:59:59 with time increasing in each 1 second.

Output Format:
00:00:00
00:00:01

23:59:59
(7 marks)
5. Write a program to find out the largest word in the string "This is an umbrella".

(9 marks)
Thank You

You might also like