How would you print the text:
Python is neato!
print("Python is neato")
In Python, what is a string or example of a string?
"any text inside quotation marks"
It's line #1 in my Python script and I want to put in the module for "random" what do I type?
import random
what does this code do:
random.choice(["1", "2", "3"])
It will randomly choose the number 1, 2 or 3
You are writing an 'if' conditional statement but when the first if statement isn't true, and you want to check for another condition before the 'else' code runs... what keyword would you write?
elif
I want to write a variable called: var that contains a value of 9000.
How would I write that?
var = 9000
True or False, you can ONLY write strings with double quotation marks: "Like these"
'False'
I want to define a function called "TacoTuesday" how would I write that?
def TacoTuesday
give me one possible number that would be generated from this code:
random.randint(10,100)
else
number = 0
while number <= 10:
print("Number: ", number)
number = number + 1
What is the last thing printed when this code is run?
10
I need to download the module for time, what do I write in the terminal?
pip install time
(or !pip install time if google collab)
I want to have a 20 second delay before my code activates, write the code that will do that
time.sleep(20)
after adding the "webbrowser" module how what code would I need to OPEN the san domenico website?
write the code
webbrowser.open("sandomenico.org")
What does this do?
x, y = random.randrange(xsize), random.randrange(ysize)
pyautogui.moveTo(x, y, duration=0.2)
moves the mouse to random positions within the x/y axis
sum = 0
values = [6,12,25,32]
for number in values:
sum = sum + number
print(sum)
What will print out when you run this code?
75
Import random
while True:
random_integer = random.randint(1, 10)
print(random_integer)
What is Wrong with this code?
The "while True" creates a loop generating random integers, however there is no break in the loop meaning the loop will continue forever
When you want to compare if two things are equal in Python, how would you write it?
==