Python Programming Basics
A quiz assessing students understanding of basic Python.
30 sec
Per question
Average time
Contest Score
Community Rating
Small Lizard
What type error is it, if your code doesn't compile?
* syntax error
* logic error
* run-time error
* binary error
Explanation: A TypeError occurs when an operation or function is applied to an object of inappropriate type.

Why explanation is about TypeError but options are other errors?
Small Lizard
Which of these statements would assign a string value to the variable MyName?
MyName = ("Horatio") is also correct answer:
Hi, I think there's an error with question 13. It looks like it is using the same question as 12 because they both say "How many variables are there in this piece of code?" but it does not make sense in question 13. In question 13 there is only one variable for "age" but the answer is "1414141414".
Small Lizard
Questions "What is the output after running this code, if the user enters the number 30?" and "Password Checker"
Actually, after running these codes, there will be extra output: "Please enter a number:" and "Welcome...\n***...\nPress..." respectively
Small Lizard
while True: ...
Here, loop will run forewer. Probably you skipped 2 indents (in 2 last lines).
Ace Sloth author
Hello, Thank you for your valuable comments, there’s a mistake with a question but I can’t edit the question. The others are understandable but I can make them more clear.
Small Lizard
class Demo: ...
Analyze the given code
This code will give SyntaxError because of Demo(''Hello''), there is two apostrophes on each side of Hello
Small Lizard
3 questions match with questions from other quiz
Cool Bear
I noticed that one of the questions ( didn't make sense as you used the term "indent" wrong. You asked: "Which of these statements repeats indented code 6 times?" The definition of the word can be found here: and you will notice that as it is used by you here it doesn't make sense.
Cool Bear
In this question: you ask "how many variables are there in this piece of code ?" There is only one variable namely "age" so the answer "1414141414" and so are the other options "70", "60" and "141414". I believe you may have made a mistake by asking the wrong question that was not intended for the answer options you provided.
Take the quiz to leave a comment