WorksheetsPython - 01
Total questions: 10
Worksheet time: 7mins
What does the following code print?
greeting = "Hello"
print(greeting)
(a)
What does the following code print?
greeting = "Hello"
print("greeting")
(a)
Which one is a correct way of creating a string variable?
name = John
name = "John"
name = ("John")
name = print("John")
Which one is a correct way of creating an integer variable?
number = "3.14"
number = 3.14
number = 314
number = ("314")
Which one is not a variable type in Python?
Int
Float
Number
Str
Boolen
What happens when you run this code?
first = "John"
print(first, "\n", last)
It prints first and last name
It only prints first name
It only prints the first name then It gives an error message
It doesn't print anything. It gives an error message
Which Python function helps collecting data from users?
(a)
Which one of the code is a correct way of collecting users' name?
print("What is your name?")
name = print("What is your name?")
input(name)
input("What is your name?")
name=input("What is your name?")
Which one is a parameter in the following code?
name = input("what is your name?")
input
name
=
"what is your name"
There is no parameter in this code
Which one is a parameter in this code?
name = input("name?")
Print("The data you entered is" , "\n", name )
"\n"
name
"The data your entered is"
All of them
