Python - Test1 Answers
- Which symbol is used to comment a line of code in Python?
ANS: #
- You have the following code segment:
#print("Hello World")
print("Hello")
#print("World")
What is the console output of this code?
ANS: Hello
- Which file name extension do Python files end in?
ANS: .py
- True or False: There is only one version of Python.
ANS: False
- Which line of code has the proper syntax for the print statement?
ANS: print( 'It\'s a smiley day' )
- True or False: You can combine a numeric value and a string by using the + symbol.
ANS: False
- Which symbol is used to indicate that a command continues on the next line?
ANS: \
- Which value type does input() return?
ANS: string
- Which variable name have proper syntax?
ANS: _myVar01
- Which of the following print statement is used to display multiple line text in python?
ANS:
print ('''Hi Everyone
Welcome to Python Test.
All the Best.''')
print ("""Hi Everyone
Welcome to Python Test.
All the Best.""")
print ("Hi Everyone\nWelcome to Python Test.\nAll the Best.")