-
What is an expression?
anything that can be turned into a value
-
What are the four types of expressions?
literals, variables, calculations, function calls
-
What is wrong with the following variable name?
1st_try
it begins with a digit
-
Is there a limit to the number of arguments you can use in a
print
function?
no
-
What is the name of the function used to read input from the keyboard?
input
-
What is purpose of the argument to the function mentioned above?
text used to prompt the user for a value
-
Write an assignment statement that asks the user for his or her name and
assigns it to the variable name.
name = input("Please enter your name: ")
-
Write an assignment statement that asks the user for an integer, converts it
to the correct data type and assigns it to the variable number.
number = int(input("Please enter an integer: "))
-
Write an assignment statement that asks the user for a decimal number, converts it
to the correct data type and assigns it to the variable number.
number = float(input("Please enter a decimal number: "))
-
Name three data types.
integer, decimal, string
or
int, float, str