User:Praveer-mathur-9f3d@uni-bonn.de
Revision as of 14:21, 6 March 2026 by Praveer-mathur-9f3d@uni-bonn.de (talk | contribs)
Short Quiz: Variable Assignment
What values do the two variables "mass" and "age" have in the following lines?
mass = 47.5
print(mass)
age = 122
print(mass, age)
mass = mass * 2.0
print(mass, age)
age = age - 20
print(mass, age)
Short Quiz: Data Types
planet = 'Earth' What datatype does the variable planet have?
apples = 5 What datatype does the variable apples have?
distance = 10.5 What datatype does the variable distance have?
false = 7 > 2 What datatype does the variable false have?
Short Quiz: Boolean Operations
var1 = True
What is the value of each variable after each of the following print statements?
var2 = False
print(var1, var2)
var2 = var1 or var2
print(var1, var2)
var1 = var1 and not var2
print(var1, var2)/code>
var1 = not(var1 and not var1)
print(var1, var2)