Exams 2024 Python For Beginners
Exams 2024 Python For Beginners
PASS MARK
IS 80%.
1. What is Python?
a) A snake
b) A programming language
c) A type of food
d) An operating system
19. What is the correct way to write a comment that spans multiple lines in Python?
a) /* This is a comment */
b) // This is a comment
c) # This is a comment
d) ''' This is a comment '''
23. How do you check if two variables refer to the same object in memory in Python?
a) variable1 == variable2
b) variable1 is variable2
c) variable1.equals(variable2)
d) variable1.equals?(variable2)
set.pop()
c) set.discard(item)
d) set.clear()
46. How do you get the current date and time in Python?
a) datetime.now()
b) currentDateTime()
c) now()
d) getDateAndTime()
number.isNegative()
c) isNegative(number)
d) number.negative()
82. How do you check if a number is greater than or equal to another number in Python?
a) number >= otherNumber
b) number.greaterEqual(otherNumber)
c) isGreaterOrEqual(number, otherNumber)
d) number.greaterOrEqual(otherNumber)
84. How do you check if a number is less than or equal to another number in Python?
a) number <= otherNumber
b) number.lessEqual(otherNumber)
c) isLessOrEqual(number, otherNumber)
d) number.lessOrEqual(otherNumber)
92. How do you check if a number is greater than another number in Python?
a) number > otherNumber
b) number.greaterThan(otherNumber)
c) isGreaterThan(number, otherNumber)
d) number.greaterThan(otherNumber)