WorksheetsPython Quiz 1
Total questions: 17
Worksheet time: 17mins
Python is a
text language
database language
programming language
Code for Hello, World!
print Hello, World!
print("Hello, World!)
print("Hello, World!")
Insert the missing part of the code below to output
_________________ "My name is ".
Python language use
upper case letters
lower case letters
upper and lower case letters
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
name = 'Dave'
print (name)
What will be the output?
name = 'Dave'
greeting = "Good morning " + name
print (greeting)
Good moning 'Dave'
Good morning Dave
Good morning name
Good morning + Dave
What is the correct syntax to output "Hello World" in python?
p("Hello World")
echo("Hello World")
print("Hello World")
How do you insert COMMENTS in Python code?
/*This is a comment*/
//This is a comment
#This is a comment
Which one is NOT a legal variable name?
Myvar
my-var
_myvar
How do you create a variable with the numeric value 5?
Both the other answers are correct.
x = 5
x = int(5)
What is the correct file extension for Python files?
.py
.pyt
.pyth
How do you create a variable with the floating number 2.8?
Both the other answers are correct.
x = 2.8
x = float(2.8)
What is the correct syntax to output the type of a variable or object in Python?
print(type(x))
print(typeOf(x))
print(typeof(x))
What is the correct way to create a function in Python?
function myfunction():
create myFunction():
def myFunction():
In Python, 'Hello', is the same as "Hello"
True
False
What bracket is a list known for?
()
{}
[]
