
1. What is the output of following code?
var1 = 1
var2 = 2
var3 = "4"
print(var + var2 + var3)
Questions include multiple choice, fill-in questions and coding project.
var1 = 1
var2 = 2
var3 = "4"
print(var + var2 + var3)
print(int(2.999))
In Python, list is immutable
In Python, dictionary is immutable
In Python, string is immutable
x, y, z = 0, 5, 5
if y > 0:
if z < 0:
x = x + 5
elif y > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
strOne = str("HelloWorld")
strTwo = "HelloWorld"
print(strOne == strTwo)
print(strOne is strTwo)
student = {1: {'name': 'Bob', 'age': '15', 'gender': 'Male'},
2: {'name': 'Alice', 'age': '12', 'gender': 'Female'}}
student = {
"name": "Alice",
"subject": "CS",
"class": 9,
"grade": "A"}