0% found this document useful (0 votes)
21 views3 pages

What Is The Output of The Following Snippet?: Applied Programming AETN2302 Python Essentials 1

This document contains an assignment with multiple choice questions testing Python fundamentals like variables, conditionals, operators, and data types. It has 8 questions testing concepts like equality, comparison, input, if/else statements and basic math operations.

Uploaded by

Helena Adam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

What Is The Output of The Following Snippet?: Applied Programming AETN2302 Python Essentials 1

This document contains an assignment with multiple choice questions testing Python fundamentals like variables, conditionals, operators, and data types. It has 8 questions testing concepts like equality, comparison, input, if/else statements and basic math operations.

Uploaded by

Helena Adam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Applied Programming AETN2302

Python Essentials 1
Assignment

Student Name: __________________________ Mark: ___________

Student Number: ________________________

1. What is the output of the following snippet?


var = 4
print(var == 4)

a) True
b) False
c) Yes
d) Var==0

2. What is the output of the following snippet?


var = 9
print(var != 4)

a) True
b) False
c) Yes
d) Var !=0

3. What is the output of the following snippet?


a = 100
b = 40
print(a>=b)

a) False
b) No
c) True
d) a>=b

1
4. What is the output of the following snippet if the user enters two lines
containing 8 and 1 respectively?
number1 = int(input("first number: "))
number2 = int(input("second number: "))

if number1 > number2:


print(number1)
else:
print(number2)

a) 8
b) 4
c) number2
d) number1

5. What is the output of the following snippet if the user enters 8?


y = int(input("number: "))
if y == 1:
print("one")
elif y == 2:
print("two")
elif y == 3:
print("three")
else:
print("Done")

a) one
b) two
c) Done
d) three

6. What is the output of the following snippet?


x, y, z = 5, 10, 30

print(x > z)
print((y - 5) == x)

a) False
True
b) False
False
c) True
True
d) True
False

2
7. What is the output of the following snippet?
x, y, z = 1, 2,3
print(x + y + z)

a) 123
b) 6
c) 0
d) Error

8. What is the output of the following snippet?


x, y, z = "2", "4", "6"
print(x + y + z)

a) 12
b) 246
c) 0
d) Error

End of Assignment

You might also like