0% found this document useful (0 votes)
0 views

Python Exam

Uploaded by

mrpalitaev
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Python Exam

Uploaded by

mrpalitaev
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Intro to Python – Fall 2021

Final

November 12 , 2021

READ THESE INSTRUCTIONS CAREFULLY!

1. You have 120 minutes to complete the exam.


2. Show full work to get full credit.
3. Work on the problem individually. Cheating will be punished with a score of 0 points.
4. No questions are allowed during the exam.
5. This is closed-book/ closed-notes exam.
6. You are only allowed to use a calculator for calculations. No cellphones, tablets or
computers are allowed. You are not allowed to share calculators.

“I have read ALL the instructions stated above and agree to abide by them and the
academic honesty stated in the university rules. I have not received any unauthorized help
during this examination”.

Name / Surname:

Signature:
1) It is required to find the longest continuous chain of zeros in the sequence of zeros and ones.
INPUT.TXT OUTPUT.TXT
00101110000110 4

2) Write a Python program to verify that the password is entered correctly by users. Go to the
Approval Editor:

 At least 1 letter between [aaz and 1 letter between [A-Z].


 At least 1 number between [0-9].
 At least 1 character from [$#@].
 The minimum length is 6 characters.
 The maximum length is 16 characters.

3) Write a program that accepts text and outputs two words: the most common and the
longest.

4) Find the key with the highest value in the dictionary:

my_dict = {'a':500, 'b':5874, 'c': 560,'d':400, 'e':5874, 'f': 20}

5) The user enters data on the number of students, their surnames, first names and score for
each. The program should save everything on a file (student.txt) and determine the average
score and output the surnames and names of students whose score is above average.

You might also like