Python E3 2020
Python E3 2020
Python E3 2020
Electronics
l"
� Ex:p1ain output statements in Python.
t
3/
9: Define positional arguments in a function,
f·
1%. What are Lists?
What are the mies fo, oreating keys in a diotionary ?
15. How the elements in a string can be accessed using fir loop?
Section Ji
r·
19. Find the area and circumference of a circle. Prompt user for input.
Describe the syntax for the following function and explain with ¥1 example :
a) abs() b) max() c) pow() d) Jen() e) sort()
¥· Describe the syntax for the following function and explain with an example :
a) replace() b) rstrip() c) reverse() d) count() e) join()
(5 x 6 = 30 marks)
Section C
Answer any two questions.
Each que.stion carries 10 marks.
'l(f. Explain the different data types used in Python with examples.
25. Write a program to print the sum of the following series: 1 + 1/2 + 1/3 + 1/4 + .... + 1/n:
26. Write a Python program using function to find the value of npr = n !/( n - r) ! Without usin� in
built factorial() function.
27. Write a Python program to ·check for the pre. sence of a key in the dictionar:y and sum all its values.
(2 X 10 = 20 marks)