What does text[:3] return?
Show answerHide answer
text[:3] slices from the beginning up to, but not including, index 3.
Practice Python basics that show up in beginner projects, AI-assisted coding sessions, and junior developer interviews. The 12 questions cover data structures, control flow, functions, exceptions, environments, files, slicing, truthiness, and common pitfalls.
This Python Fundamentals quiz is a Practical fundamentals check. It covers lists, dictionaries, loops, functions, exceptions, virtual environments, comprehensions, imports, files, slicing, and truthiness. The quiz has 12 questions, takes about 8 minutes, and a score around 8 out of 12 means you have a workable baseline.
The 12 questions on this page are built for practical Python fundamentals screening. They focus on practical decisions you would make while building, debugging, querying, or operating real projects.
Yes. The quiz checks beginner-to-junior Python fundamentals that often appear in coding interviews and technical screens: lists, dictionaries, loops, functions, exceptions, virtual environments, imports, file handling, slicing, truthiness, and mutable defaults.
Start with lists and dictionaries, then learn loops, functions, exception handling, imports, virtual environments, file context managers, list comprehensions, slicing, truthy values, and the mutable-default-argument pitfall.
Yes. Each question gives immediate feedback in the quiz, and each linked question explanation page breaks down the correct answer, distractors, practical rule of thumb, and related practice questions.
No. The public Python Fundamentals quiz is free and starts without signup.
Three examples from the 12-question quiz. Answers stay hidden until you reveal them.
What does text[:3] return?
text[:3] slices from the beginning up to, but not including, index 3.
Why use with open("file.txt") as f?
The with statement uses a context manager. For files, it ensures the file is closed even if an error occurs.
Which value is falsy in Python?
Empty containers such as [], {}, set(), and "" are falsy. Non-empty containers are truthy even if they contain zero or the string false.
Compare your fundamentals across Git, AWS, Linux, SQL, Python, and Docker.
See all free quizzes