3.16 Hacks
hack one
simulation of the pixels on a monitor screen.
As time increases, then the pixels start to die and certain colors like red blue and green can burn into the screen and cause shadows.
This simulation can effect the real world that can represent the life on an actual pixel and how it can burn out.
hack two
questions_number = 6
answers_correct = 0
questions = [
"True or False: Simulations will always have the same result. \n A: True, \n B: False",
"True or False: A simulation has results that are more accurate than an experiment \n A: True, \n B: False",
"True or False: A simulation can model real world events that are not practical for experiments \n A: True, \n B: False",
"Which one of these is FALSE regarding simulations \n A: Reduces Costs, \n B: Is safer than real life experiments, \n C: More Efficient, \n D: More accurate than real life experiments",
"Which of the following scenarios would be the LEAST beneficial to have as a simulation \n A: A retail company wants to identify the item which sold the most on their website, \n B: A restaurant wants to determine if the use of robots will increase efficiency, \n C: An insurance company wants to study the impact of rain on car accidents, \n D: A sports car company wants to study design changes to their new bike design ",
"Which of the following is better to do as a simulation than as a calculation \n A: Keeping score at a basketball game, \n B: Keeping track of how many games a person has won, \n C: Determining the average grade for a group of tests, \n D: Studying the impact of carbon emissions on the environment"
]
question_answers = [
"B",
"B",
"A",
"D",
"A",
"D"
]
print("Welcome to the Simulations Quiz!")
def ask_question (question, answer):
print("\n", question)
user_answer = input(question)
print("You said: ", user_answer)
if user_answer == answer:
print("Correct!")
global answers_correct
answers_correct = answers_correct + 1
else:
print("You are incorrect")
for num in range(questions_number):
ask_question(questions[num], question_answers[num])
print("You scored: ", answers_correct, "/6")
hack three
Guiding Questions:
1) It makes it simulation because it isnt real, and you can get solid data from the experiment.
2) Advantages: Faster, simpler, and more efficient and easier to get data, cheaper. Disadvantages: Less accurate and les data
3) I think its better in real life because it is more fun to actually play the game and take the time to get the data, rather then just get the data more quickly and efficient.
def parse_input(input_string):
if input_string.strip() in {"1", "2", "3","4", "5", "6"}:
return int(input_string)
else:
print("Please enter a number from 1 to 6.")
raise SystemExit(1)
import random
def roll_dice(num_dice):
roll_results = []
for _ in range(num_dice):
roll = random.randint(1, 14)
roll_results.append(roll)
return roll_results
num_dice_input = input("How many dice do you want to roll? [1-6] ")
num_dice = parse_input(num_dice_input)
roll_results = roll_dice(num_dice)
print("you rolled:", roll_results)
import random
a = int(input("First number of your domain"))
b = int(input ("Second number of you domain"))
y = int(input("How many dice do u want to roll?"))
for i in range(y):
x = random.randint(a,b)
print("You rolled "+ str(x))
bro = input("Want conditionals of the latest data?")
ratio = x/b
if bro == "yes":
print("The ratio of the dice to the end of the domain is " + str(ratio))
time = int(input("How many hours has the pixel been running?"))
x = random.randint(1,3)
if x == 1:
color = "red"
if x == 2:
color = "blue"
else:
color = "green"
if time > 1000:
print("A lot of the pixels have been burned out the the color, "+ color + " which are now shadows on the screen")
else:
print("The pixels haven't been running for a long enough time!")