Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 830 Bytes

File metadata and controls

22 lines (16 loc) · 830 Bytes

Do Now 3.01

In your console

Type the following code into the editor, then run the program:

    import random
    print(random.randint(0, 3))
    print(random.randint(0, 3))
    print(random.randint(0, 3))

In your notebook

Respond to the following:

  1. What does randint() do?
  2. What do the values 0 and 3 do? Try changing those numbers and rerun the program.
  3. Try typing the same lines above, directly into the Python console, hitting Enter after each line. Is anything different about executing code in interactive mode?
  4. What happens if you leave out the print() command, and instead just type random.randint(0, 3) into the console?
  5. What happens differently if you remove print() from one or more lines in the original program above, and re-run that? Why does that happen?