Python

Core Python Fundamentals Interview Questions

Python syntax, data types, indentation, PEP 8, slicing, and interpreter basics.

  • 20Questions with answers
  • 3Difficulty levels

Questions (20)

Browse beginner, intermediate, and advanced questions with answers — hide them when you want to self-test.

Question 1
Interview Beginner
Question

What are the key features of Python?

Answer:

Python is simple, interpreted, dynamically typed, object-oriented, and supports multiple programming paradigms with a large standard library.

Question 2
Interview Beginner
Question

What is Python?

Answer:

Python is a high-level, interpreted programming language used for web development, data science, automation, and AI.

Question 3
Interview Beginner
Question

Is Python compiled or interpreted?

Answer:

Python is an interpreted language, meaning code is executed line by line by the Python interpreter.

Question 4
Interview Beginner
Question

What are Python data types?

Answer:

Common Python data types include int, float, str, list, tuple, set, dict, and bool.

Question 5
Interview Beginner
Question

What is type casting in Python?

Answer:

Type casting is converting one data type into another using functions like int(), float(), str(), etc.

Question 6
Interview Beginner
Question

What is difference between list and tuple?

Answer:

Lists are mutable, while tuples are immutable. Lists use [], tuples use ().

Question 7
Interview Beginner
Question

What is indentation in Python?

Answer:

Indentation defines code blocks in Python and is mandatory for loops, functions, and conditionals.

Question 8
Interview Intermediate
Question

What is a variable in Python?

Answer:

A variable is a container for storing data values and does not require explicit type declaration.

Question 9
Interview Intermediate
Question

What are keywords in Python?

Answer:

Keywords are reserved words like if, else, for, while, def, class that have special meaning in Python.

Question 10
Interview Intermediate
Question

What is PEP 8?

Answer:

PEP 8 is the official Python style guide that defines coding conventions for readability and consistency.

Question 11
Interview Intermediate
Question

What is the difference between is and ==?

Answer:

== compares values, while is compares memory locations (identity).

Question 12
Interview Intermediate
Question

What are comments in Python?

Answer:

Comments are used to explain code and are ignored by the interpreter. They start with # or triple quotes.

Question 13
Interview Intermediate
Question

What is slicing in Python?

Answer:

Slicing is used to extract a portion of sequences like lists or strings using start:end:step syntax.

Question 14
Interview Intermediate
Question

What is input() function?

Answer:

input() is used to take user input from the console as a string.

Question 15
Interview Advanced
Question

What is Python interpreter?

Answer:

The Python interpreter executes Python code line by line and converts it into machine-readable instructions.

Question 16
Interview Advanced
Question

Which Python built-ins or stdlib modules matter most for Core Python Fundamentals?

Answer:

Name concrete modules (collections, itertools, pathlib, typing) and how they support Core Python Fundamentals. Prefer stdlib before third-party when it is enough.

Question 17
Interview Advanced
Question

How do mutable default arguments or late binding bite you with Core Python Fundamentals?

Answer:

Explain the classic default-list bug and closures in loops. Show a safe pattern when Core Python Fundamentals uses defaults or lambdas.

Question 18
Interview Advanced
Question

What testing tools would you use for Core Python Fundamentals logic?

Answer:

pytest with fixtures, parametrize, and coverage. Mock I/O at boundaries so Core Python Fundamentals unit tests stay deterministic.

Question 19
Interview Advanced
Question

How does typing improve Core Python Fundamentals maintainability?

Answer:

Annotate public APIs, use mypy/pyright in CI, and prefer Protocols for duck typing. Catch Core Python Fundamentals contract breaks before runtime.

Question 20
Interview Advanced
Question

When would you choose a generator or comprehension for Core Python Fundamentals?

Answer:

Generators save memory for large streams; comprehensions are clear for small transforms. Justify the choice for Core Python Fundamentals data sizes.

Practice with AI mock interviews

Run Python mock interviews with AI follow-ups, instant feedback, and analytics on AiLx.

Free to start · No credit card required