NEW
Font size
WorksheetsAI for Youth – Machine and Minds
Total questions: 10
Worksheet time: 5mins
print("Hello" + " World")
Hello World
HelloWorld
Hello+World
Error
What is the correct way to take input from a user in Python?
input = "Enter your name"
name = input("Enter your name: ")
name = input["Enter your name"]
input(name) = "Enter your name"
What will be the output of the code?
Yes
No
Error
None
Which of the following is immutable (cannot be changed) in Python?
List
Tuple
Dictionary
Set
How do you access the value of key 'age' in the dictionary?
student[age]
student.get("age")
student("age")
student.get(age)
What will be the output of the following list operation?
[1, 2, 3]
[1, 2, 3, 4]
[1, 2, 3, 4, None]
[1, 2, 3, (4)]
What is the correct way to check if a key exists in a dictionary?
'key' in dict
dict.has_key('key')
dict.exist('key')
dict.find('key')
What does len([1, 2, 3, 4]) return?
3
4
[1, 2, 3, 4]
Error
How do you create an empty list in Python?
{}
set()
[]
()
What will be the output of the following code?
(1, 5, 3)
(1, 2, 3, 5)
Error
[1, 5, 3]
