Professional Documents
Culture Documents
Exam
4 Explain variable scope and lifetime with example. Refer below code, what will be the
def function1(numbers):
total =0
for c in numbers:
total += x
return total
print(function1((8,2,3,0,7)))
8 Concatenation of string
9 Repetition of string
11 Appending of string
16 Write a Python program to count the occurrences of each Word in a given sentence
20 Write a python program for student database management. Program should include
Following functions.
i. Adding a student
24 Define files and enlist types of files. Also explain absolutes and relative file path
26 Define dictionary with syntax. Also explain two methods to remove an item from
dictionary.
28 Write a python program to read lines method and write lines method
37 Short note on. ord(), chr() function along with in not in operator.
38 Explain the operations- Concatenation and appending of string with necessary illustration.
39 Write a python program to accept string and display reverse string and palindrome
46 Write a python program to create a class ‘Rectangle’. Also find the area and perimeter o
47 Define file. Explain different types of file. Give significance of with keyword?
49 Write a program in python to count number of vowels and consonants present in the text file
50 Differentiate between- i. Absolute file path and Relative file path ii. File and Folder