quiz 1 Flashcards
Which of the following are true about Python:
(1) Python is interpreted
(2) Python is Object Oriented
(3) Python is interactive
All are correct
Which of the following statements is true?:
a. Python 3 is a newer version, but it is backward compatible with Python 2.
b. Python 3 is a newer version, but it is not backward compatible with Python 2.
c. A Python 2 program can always run on a Python 3 interpreter.
d. A Python 3 program can always run on a Python 2 interpreter.
b. Python 3 is a newer version, but it is not backward compatible with Python 2.
Converting a variable’s value from one data type to another is most often called _________
casting
Python syntax is case-sensitive.
True
In Python, a syntax error is detected by the ________ at _________.
interpreter/at runtime
Consider this Python code:
value = input(“Please enter a number:”)
value = int(value)
print(“You entered”, value)
If we ran this code and a user entered spam as the input to the prompt, what would be the output?
Error (“spam” is not an integer)
A Python line comment begins with ________.
#
Select ALL of the correct statement(s):
a. print(‘Hello world’) # This is a statement.
b. An expression performs some task but does not return a value.
c. A statement is a combination of values and operations that creates a new value.
d. A statement may have a side effect.
A and D
Python features include:
(1) interactive mode
(2) portable
(3) easy to add modules
True