Tricky Python Interview Questions
Five medium-difficulty Python coding questions designed to test key habits, core behaviors, and reasoning — answers reveal after a short pause.
Try this quiz
Play through the questions and see your score instantly
Ready to test your knowledge?
5 questions · Quick play · Instant results
Make your own quiz videos
Turn any topic into a polished video quiz — with AI-powered questions, voiceover, and animations. No video editing skills needed.
Unlimited quizzes, free to start
Create as many quizzes as you want. Describe your topic and AI builds the questions, answers, and explanations for you.
Customise everything
Pick from stunning templates, tweak colours and fonts, add your branding, and choose between vertical or landscape formats.
Export-ready videos
Download HD videos optimised for TikTok, YouTube Shorts, Instagram Reels, or full-length YouTube — one click, no editing.
No credit card required
Quiz Questions & Answers
Review every prompt, the correct responses, and helpful context to prep for your own run-through.
Question 1: What prints when you run: x = [1,2,3]; y = x; y.append(4); print(x)?
[1, 2, 3, 4]
Question 2: Which outcome occurs for: def f(a, L=[]): L.append(a); return L; f(1); f(2)?
[1, 2]
Question 3: Given: a = (1,2); b = (1,2); a is b evaluates to what and why?
False
Question 4: What does dict.fromkeys(['a','b'], []) produce if you then append to one key's list?
{'a': [val], 'b': [val]} (same shared list for both keys)
Question 5: Which behavior is correct: iterating while modifying a list you're iterating over?
It leads to unexpected behavior; avoid modifying the list during iteration