Hacks

  • Write a program that uses a library/libraries in any sort of manner.
  • Explain your work/code
import math

sqrt = math.sqrt(int(input()))
print(sqrt)
6.782329983125268

Hacks for lesson 3.15.1

  • Define what an import random function do
  • List a few other things that we can import other than random
  • import random function imports the random dictionary and choses a random number between the set range.
  • you can import flask, dictionary, and you can install many more library

Hacks 3.15.2

  • For your hacks you need to create a random number generator that will simulate this situation:
  • There is a spinner divided into eight equal parts. 3 parts of the spinner are green, two parts are blue, one part is purple, one part is red, and one part is orange. How can you simulate this situation using a random number generator.

  • Also answer this question: What numbers can be outputted from RANDOM(12,20) and what numbers are excluded?

import random

rand = random.randint(1,6)

if rand == (1 or 2 or 3):
    print ("green")

if rand == (4 or 5):
    print ("blue")

else:
    print("red")
blue
  • the numbers that can be choses are 12 trough 20 and the numbers that are excluded are the ones that are not in the restriction