Getting started with Python Series: Reinforce your knowledge

A mini-quiz for Steps 0 and 1

Below are 6 questions to reinforce what you learned in Steps 0 and 1 in this Getting started with Python Series. Questions 1-2 are true/false and Questions 3-6 are multiple choice with 3 answer choices (A, B, C).

Questions

Question 1: Coding in Python can be extremely satisfying and frustrating (sometimes both within a 5 minute span), for both beginner and experienced coders.

  • True
  • False

Question 2: Blocking out time on your calendar for "learning Python" can help you to stay accountable and continue to make progress even when things are busy.

  • True
  • False

Question 3: Which of the following is the icon for the terminal, which you can use to navigate the file system in your computer and also open Python?

  • A. red circle
  • B. magnifying glass
  • C. black square

Question 4: If you type the command

pwd

on the command line, what does it tell you?

  • A. the directory that you are currently in
  • B. a list of all the files and directories that stored in the directory

Question 5 If you open the terminal and type

python3

what symbols should appear so that you know that you can now type in Python?

  • A. NA
  • B. ---
  • C. >>>

Question 6: If you open Python on the terminal and enter the command

print('What color is the sky?)

you will get an error. Specifically, it will say "SyntaxError: EOL while scanning string literal." Why do you think that this error appeared?

  • A. Python doesn't know what color the sky is
  • B. Python generally doesn't understand the command called "print"
  • C. Python can't read the command because there is a " ' " missing

Answers:

Question 1: True. Coding can be challenging and awesome for Python users of all experience levels. At first, I thought it would "be easy" when I got more experience. There are some aspects of it that are easier, but I still find that I hit roadblocks all the time!

Question 2: True. Setting up times to learn coding is a great way to remain accountable.

Question 3: B. The black square is for the terminal. In contrast, the magnifying glass can be used to search all applications and find the terminal. The red circle is one way to exit the terminal.

Question 4: A. The command pwd tells you what the directory that you are currently in. In contrast, the command ls tells you a list of all the files and directories that stored in the directory.

Question 5: C. >>> is the symbol for Python. You can try this yourself by typing

python3

onto the command line in the terminal and looking to the left of the gray box (called the command prompt).

Question 6: C. Python can't read the command because there is a " ' " missing. This error occurred because of a syntax issue (missing " ' " after the question mark). The answer choice B is incorrect because print is a general command in Python and it will run as long as the syntax is correct. The answer choice A is incorrect because while it is true that Python doesn't know what color the sky is, it can still print the question if the syntax is correct.

You can verify that C is the correct answer by opening Python and typing

print('What color is the sky?)

and then

print('What color is the sky?')

Did you find this article valuable?

Support Codo Sapiens by becoming a sponsor. Any amount is appreciated!