ABC 32343307 Sec Python Practical2021
ABC 32343307 Sec Python Practical2021
Give the code (of all files) & screenshots of the outputs in a single PDF file.
(If you do not have a PC/laptop handwrite the code/ pseudocode and handwrite
the outputs), take pictures and make a single PDF.)
1. (Those that are handwriting the code) Attempt the questions (handwritten) on blank
A4 sheets. Give page number on each page of the answer sheet. After completing
your paper, make a single PDF of the answer sheets.
2. Ensure that the images are clear and readable.
3. Write your Course Name & Semester, Paper Code, your University Roll Number,
your Name and today’s Date, on the top of the 1st page
4. Rename the PDF file to SEC-Python-UnivRollNo-Name.pdf
(E.g. of file name: SEC-Python-21059570002-Neeraj.pdf)
5. Upload PDF in the Google Classroom > Classwork latest by 1:30 pm today, 13th
December 2021. Do not forget to click the ‘Turn in’/ ‘Mark as done’ button.
6. In case of any problem, or you were unable to upload your file, call the teacher.
ATTEMPT ALL QUESTIONS
Q1. Write a Python program (use function main() ) that does the following (and makes
a. Prompts user to input the number of employees, n, for whom data is to be input
• For each of the n employees, inputs Employee First Name, Sex and
c. Calls a function displayEmpFile(‘EmpData.txt’) that reads data from the file (line
Q2. Write a Python program that does the following (and makes calls to the specified
functions):
b. Calls a function createList(x) which creates a list of x numbers input from the user.
and inserts the factorial of this number into a dictionary dFactorial. This function
returns dFactorial.
[the {key: value} of the dictionary is the number and its factorial {n: n!}]
*********