Back to Python Fundamentals
Final Assessment

Python Fundamentals Final Assessment

Test your complete Python mastery across variables, strings, decisions, loops, references, functions, dictionaries, TXT/CSV/JSON files, pytest testing, OOP & inheritance, and virtual environments. Score 70% or higher to earn your certificate.

Answered 0 of 15 questionsPass mark: 70%
Question 1

Question 1 of 15

What is the data type of value = '42' in Python?

Question 2

Question 2 of 15

What does input('Enter age: ') return when the user types 21?

Question 3

Question 3 of 15

What does 'Python'[::-1] return?

Question 4

Question 4 of 15

What is the result of 15 // 4 and 15 % 4?

Question 5

Question 5 of 15

If score = 95, what does if score >= 50: print('Pass') elif score >= 90: print('Top') print?

Question 6

Question 6 of 15

Which numbers does range(2, 6) generate?

Question 7

Question 7 of 15

After a = [1, 2]; b = a; b.append(3), what is a?

Question 8

Question 8 of 15

What does student.get('phone', 'None') do if 'phone' is missing from student?

Question 9

Question 9 of 15

What does a function return if it prints a value with print() but has no return statement?

Question 10

Question 10 of 15

Why should you use csv.DictReader instead of line.split(',') for .csv files?

Question 11

Question 11 of 15

Which exception is raised when executing int('abc')?

Question 12

Question 12 of 15

What happens when an assert check inside a pytest test evaluates to False?

Question 13

Question 13 of 15

Inside a Python class, what does self refer to?

Question 14

Question 14 of 15

In a child class like class SavingsAccount(BankAccount):, what does super().__init__(owner, balance) do?

Question 15

Question 15 of 15

Which command saves your project's installed pip packages so teammates can recreate .venv?

Answer 15 more questions to submit.