what is 15 % 4
3
print ("hello" + "world")
helloworld
x = 5
if x > 5:
print("large")
else:
print("small")
small
weight = input("How much do you weigh? ")
weight = float(input("How much do you weigh? "))
Strings can only be concatenated with __________
Strings
what is 7 % 9
7
x = "I am"
y = 6
z = "feet tall"
print z
print x
print y
feet tall
I am
6
What is the output if the user inputs "great"?
response = input("How are you?")
if response == "Great":
print("Glad to hear.")
else:
print("Have a good day.")
Have a good day.
print ("You should drink " + (oz_water))
oz_water= 45
print ("You should drink " + str(oz_water))
The way we speak to each other
Natural Language
What is the output
4 + 7 * 2 + 12/6
20
print ("Nightmare on Cook Street\n\t\tXavier Homecoming")
Nightmare on Cook Street
Xavier Homecoming
score = 80
if score > 90:
print("A")
elif score > 80:
print("B")
elif score > 70:
print("C")
elif score > 60:
print("D")
else:
print("F")
C
x = NY Giants
print int(x)
x ="NY Giants"
Computer Language
Formal Language
What is the output
14%7 + 8 * 3 / 5
6
num1 = input("Enter a two-digit number."). 80
num2 = input("Enter a one-digit number."). 5
print (num1 + num2)
805
What is output?
100 != 100
False
num = 8
print "num"
num = 8
print(num)
X = True
Y = False
X and Y
False
11 + 6 / 3 * 2 - 1
14
rain = True
if not rain :
print("Take an umbrella")
else:
print("No need for an umbrella")
No need for an umbrella
Consider the following code:
x = 5 % 4
if (x == 1):
print (“1”)
elif (x == 2):
print (“2”)
elif (x == 3):
print (“3”)
else:
print (“4”)
name = "Alyx"
age = 32
print "name" + "is " + age
name = “Alyx”
age = 32
print(name + "is " + str(age))
X = True
Y = False
X OR Y
TRUE