IT 116: Introduction to Scripting
Answers to Class 4 Ungraded Quiz

  1. What must the first character of a variable name be?
    uppercase letters, lowercase letters and the underscore
  2. What must all the other characters of a variable name be?
    uppercase letters, lowercase letters, digits and the underscore
  3. What is wrong with the following variable name?
    1st_try
    it begins with a digit
  4. Is there a limit to the number of arguments you can use in a print function?
    no
  5. What is the name of the function used to read input from the keyboard?
    input
  6. What is purpose of the argument to the function mentioned above?
    text used to prompt the user for a value
  7. 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: ")
  8. 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: "))
  9. 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: "))
  10. Name the three data types we have discussed in this class.
    integer, decimal, string
        or
    int, float, str