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

  1. If you wanted to use the functions in the math module inside your script, what statement should appear at the top of the script?
    import math
  2. If you wanted to print the value of pi from the math module, what statement would you use?
    print(math.pi)
  3. Write the a function call that will return the value of the sine of π. The sine function in the math module is sin
    math.sin(math.pi)
  4. Write the function call that will return the floor of the value 5.6 using the floor function in the math module.
    math.floor(5.6)
  5. Write the function call that will return the ceiling of the value 5.1 using the ceil function in the math module.
    math.ceil(5.1)
  6. Are the series of number created by the function is the random module really random?
    no. they are a pseudorandom number sequence
  7. If you wanted to use the functions in the random module inside your script, what statement should appear at the top of the script?
    import random
  8. If you wanted to simulate the throw of a die using the randint function of the random module, what would you use as the function call?
    random.randint(1,7)
  9. What is the range of numbers created by the random function of the random module.
    0 to 1.0
  10. What do you call the initial value given to an algorithm used to generate "random" numbers.
    seed