{"id":1884,"date":"2018-12-30T12:00:00","date_gmt":"2018-12-30T11:00:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/python-programming-quiz\/"},"modified":"2026-08-26T21:43:03","modified_gmt":"2026-08-26T19:43:03","slug":"python-programming-quiz","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/python-programming-quiz\/","title":{"rendered":"Python Programming Quiz"},"content":{"rendered":"<p><!-- ktg-updated-banner --><\/p>\n<p><em>Updated August 2026 \u2014 quiz hub restored (interactive HDquiz embed was lost; practice questions are inline below).<\/em><\/p>\n<p>Welcome to the <strong>Python Programming Quiz<\/strong> hub on The Genius Blog. Use these questions to check fundamentals, then follow the tutorial links to go deeper.<\/p>\n<p>Related on this blog:<\/p>\n<ul>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/easy-free-python-tutorials-with-step-by-step-examples-and-quiz\/\">Easy Free Python Tutorials (with quiz)<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/tkinker-for-beginners\/\">Tkinter for Beginners<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/everything-about-linked-list-with-python-code-and-hackerrank-leetcode-solutions\/\">Linked Lists in Python<\/a><\/li>\n<\/ul>\n<p>We will cover:<\/p>\n<ol>\n<li><a href=\"#t1\">Warm-up questions<\/a><\/li>\n<li><a href=\"#t2\">Lists and loops<\/a><\/li>\n<li><a href=\"#t3\">Functions<\/a><\/li>\n<li><a href=\"#t4\">Answers<\/a><\/li>\n<\/ol>\n<p><strong id=\"t1\">1. Warm-up questions<\/strong><\/p>\n<ol>\n<li>What does <code>type(3.0)<\/code> return in Python 3?<\/li>\n<li>Is <code>x = 1<\/code> followed by <code>x = \"hi\"<\/code> legal?<\/li>\n<li>What is the result of <code>True + True<\/code>?<\/li>\n<\/ol>\n<p><strong id=\"t2\">2. Lists and loops<\/strong><\/p>\n<ol start=\"4\">\n<li>What does <code>[1, 2, 3][-1]<\/code> evaluate to?<\/li>\n<li>How do you make a shallow copy of list <code>a<\/code> without sharing identity?<\/li>\n<li>What does this print?\n<pre><code>for i in range(3):\n    print(i, end=\"-\")\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><strong id=\"t3\">3. Functions<\/strong><\/p>\n<ol start=\"7\">\n<li>What is the default return value of a function with no <code>return<\/code>?<\/li>\n<li>Does Python pass arguments by value or by object reference?<\/li>\n<li>Write a one-liner that doubles every element of <code>nums<\/code> using a list comprehension.<\/li>\n<\/ol>\n<p><strong id=\"t4\">4. Answers<\/strong><\/p>\n<ol>\n<li><code>&lt;class 'float'&gt;<\/code><\/li>\n<li>Yes \u2014 variables are names bound to objects; types can change.<\/li>\n<li><code>2<\/code> (booleans subclass <code>int<\/code>)<\/li>\n<li><code>3<\/code><\/li>\n<li><code>a.copy()<\/code> or <code>a[:]<\/code> or <code>list(a)<\/code><\/li>\n<li><code>0-1-2-<\/code><\/li>\n<li><code>None<\/code><\/li>\n<li>By object reference (names refer to objects; mutable objects can change in place)<\/li>\n<li><code>[n * 2 for n in nums]<\/code><\/li>\n<\/ol>\n<p>Score yourself honestly, then open a tutorial from the links above and rebuild anything you missed. For more interactive quizzes historically hosted via HDquiz, treat this page as the stable index going forward.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updated August 2026 \u2014 quiz hub restored (interactive HDquiz embed was lost; practice questions are inline below). Welcome to the Python Programming Quiz hub on &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[35],"tags":[],"class_list":["post-1884","post","type-post","status-publish","format-standard","hentry","category-algorithms"],"acf":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=1884"}],"version-history":[{"count":2,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1884\/revisions"}],"predecessor-version":[{"id":2467,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/1884\/revisions\/2467"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=1884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=1884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=1884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}