Unit 8 Flashcards
1
Q
how do you add a and b?
A
a+b
2
Q
how do you subtract a from b?
A
b-a
3
Q
how do you multiply a and b?
A
a*b
4
Q
how do you do a divided by b?
A
a/b
5
Q
how do you assign a variable?
A
a=hello
6
Q
how do you find the remainder?
A
10%2
7
Q
what is the output of 10%2?
A
0
8
Q
what does \t add?
A
tab of space
9
Q
what is the formula for printing ‘hello’?
A
print(“hello”)
10
Q
what does a//b give?
A
gives the answer without any decimal points
11
Q
formula for conditional statements
A
input=float(input(“write your guess”))
if(input==25):
print(“You guessed it!”)
else:
print(“Wrong, try again”)