Here is class 12 computer science Unit 2 [Type B] solutions for Sumita Arora back exercise assignment. Below includes both textual and video solutions wherever required. View all the answers in assignment for chapter 2 and for all chapters here.Watch all tutorials for chapter 2: Python Revision Tour.
x=["hello", "world", "python", "a", "symbol"] add =0 for ch in x: add +=len(ch) avg_len =add/len(x) print(avg_len)
Output: [4, 3, 2]
(a) Output: 2 3 4 5 6 6 (b) Output: 1 # 1 # 2 # 1 # 2 # 3 #
(a) tuples are immutable. Hence, t[0]=6 will cause error. (b) The command in this case will run as the list are mutable. (c) Error will rise as the index is out of range. (d) Strings are immutable. Hence, t[0]="H" will cause error. (e) Syntax error will cause error as absence of ":", "If".
Yes, it will show as because out of index. In first case reading len(words) will return value out of index of list words.
a is : Hello b is : Nita c is : How’s d is : life ? HiNita
(d) True
(a) True
30 {(1, 2, 4): 8, (4, 2, 1): 10, (1, 2): 12}
for i in List: if i.isnumeric() == True: print(i*3) else: print(i+'#')
(i) string_name.upper() (ii) len(string_name)
Clear Doubts with Computer TutorIn case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in
You cannot copy content of this page