Quiz
Python 3 Quiz 1
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (12)
1Which file extension should you use at the end of your Python files to make the most of the IDLE environment?
- A.Python
- B.py
- C.IDLE
- D.idl
2If a language is case-sensitive, it means what?
- AThe capitalization of each letter of output is important.
- BThe capitalization of each letter of the file name is important.
- CThe capitalization of each letter of source code is not important.
- DThe capitalization of each letter of source code is important.
3In Python, in order to print a literal string to the screen, what must you do to the characters that make up the string?
- AEnclose them in double quotes (" ").
- BEnclose them in ({ }).
- CEnclose them in (< >).
- DEnclose them in ([ ]).
4What is the error in the following line of code that reads the city name from the user?
Ex. location = eval( input("Please enter the name of your city: "))- AThe eval function is used to convert the input data to a number, but a city name is a string.
- BThere is no function named input in Python 3.
- CYou aren't allowed to pass the input function a string.
- DThe variable name, location, is a reserved word.
5Which of the following characters is used to tell Python that the remaining part of the line is a comment?
- A'
- B//
- C/
- D#
6Which of the following keywords is used to get access to a library file?
- Ausing
- Bimport
- Cinclude
- Dlibrary
7Which of the following statements about nested ifs is correct?
- APython doesn't allow you to nest an if statement inside another if statements.
- BPython allows you to put an if statement only inside the true path of another if statement.
- CPython allows you to put an if statement only inside the false path of another if statements.
- DPython allows you to put an if statement inside either the true or false path of another if statement.
8Which of the following statements will determine if the value in the letter variable comes before the letter "S"?
- Aif letter is Before "S":
- Bif letter < "S":
- Cif letter > "S":
- Dif letter != "S":
9Which of the following statements will determine if the playAgain variable contains the word "yes" and the maxTries variable is less than the number 5?
- Aif playAgain = "yes" and maxTries < 5:
- Bif playAgain == "yes" and maxTries < "5":
- Cif playAgain == yes and maxTries < 5:
- Dif playAgain == "yes" and maxTries < 5:
10What is the output after running the following code segment?
for i in range(0, 5):
print(i)- AThe number 5 printed five times.
- BThe values increasing from 0 to 4, inclusive.
- CThe values decreasing from 4 to 0, inclusive.
- DThe values increasing from 0 to 5, inclusive.
11Which of the following while statements is valid and will stop the loop when the value in the variable d is no longer equal to 10?
- Awhile d = 10
- Bwhile d == 10
- Cwhile d = 10:
- Dwhile d == 10:
12Which of the following statements forces the computer to exit the current control structure and begin executing the code following this structure?
- Abreak
- Bcontrol
- Cskip
- Dcontinue
Information
- Description
- 10th grade Computer Science Quiz on Python 3 Quiz 1, created by Alexandra Brown on 30/10/2018.
- Author
- Alexandra Brown
- Language
- English
- Views
- 0
- Tags
- Rating
- No ratings yet Rate this quiz