Python · Module 1Module material
Getting Started interview questions
25 questions interviewers ask on this module’s topics, from first principles to the follow-ups. Each comes with a model answer.
Python and notebooks
- Is Python compiled or interpreted?●
- What is the difference between Python 2 and Python 3 that you are most likely to notice?●
- What is the difference between a statement and an expression?●
- In a Jupyter notebook, why can a cell that worked earlier fail after a restart, and what do you do about it?●●
Variables and types
- Is Python statically or dynamically typed? Is it strongly or weakly typed?●
- What actually happens in
x = 5?●● - What is the difference between
isand==?●● - Are integers mutable? What does
x += 1do to the object?●● - How do you swap two variables in Python?●
- What is
None, and how do you check for it?● - Can you name a variable
list? Should you?●● - What are type annotations, and does Python enforce them?●●
Conversion and truthiness
- What does
input()return?● - Which values are falsy in Python?●●
- What is the difference between
int(2.9)andround(2.9)?●● - Why is
"10" > "9"False?●●
Operators
- What is the difference between
/and//?● - What is
-7 // 2, and-7 % 2? Why?●● - What do
2 ** 3 ** 2and-2 ** 2evaluate to?●● - Why is
0.1 + 0.2 == 0.3False, and how should you compare floats?●● - What do
andandorreturn?●● - What is
True + True?●●
Formatting
- What does
printreturn? What do itssepandendarguments do?● - How do you print a number with two decimal places and a thousands separator?●
- What does
f"{x=}"do?●●