Professional Documents
Culture Documents
Q-1 a) Write a program to read a text file my_file.txt and display the
number of vowels/consonants/uppercase/lowercase characters in
the file. 8
Example:
File Contents as given below
Python is super and trending language.
Allows to store the output in the files.
A text file stores textual data.
Program output must be as follows
Vowels: 35
Consonants: 58
Uppers: 3
Lowers: 87
b) Observe the following code and fill in the given blanks as directed: 4
i. Write function name to create cursor and fill in the gap for
statement 3.
iv. Write a query to fill statement 4 to create database Customers.
Example:
File Contents as given below
Python is super and trending language.
Allows to store the output in the files.
A text file stores textual data.
Binary files can handle binary data.
Binary files use pickle module to store data.
CSV files can handle tabular data.
CSV files can be read easily using CSV reader object.
b) Observe the following code and fill in the given blanks as directed: 4
ii. Write function name to create cursor and fill in the gap for
statement 3.
iii. Write a query to fill statement 4 to create database Customers.