WorksheetsData Types
Total questions: 10
Worksheet time: 5mins
What will be the result of the following code:
x = 'Welcome'
print(x[3])
Wel
c
Welcome Welcome Welcome
Which of the follwing repersents list data type?
N={1,2,3}
N=[1,2,3]
N= (1,2,3)
If x = 9, what is a correct syntax to print 'The price is 9 dollars'?
print(f'The price is {x:f} dollars')
print(f'The price is {x} dollars')
print(f'The price is {x:f(2)} dollars')
What will be the result of the following code:
prinThe price is 23 dollars
The price is 5 dollars
The price is {2 + 3} dollars
The price is 6 dollars
t(f'The price is {2 + 3} dollars')
True or False.
List items cannot be removed after the list has been created.
True
False
Whis one of theese is a dictionary?
x = ('apple', 'banana', 'cherry')
x = {'type' : 'fruit', 'name' : 'banana'}
x = ['apple', 'banana', 'cherry']
True or False.
Dictionary items cannot be removed after the dictionary has been created.
True
False
Whis one of these is a tuple?
thistuple = ('apple', 'banana', 'cherry')
thistuple = ['apple', 'banana', 'cherry']
thistuple = {'apple', 'banana', 'cherry'}
Use the correct syntax to print the number of items in the fruits tuple.
fruits = ("apple", "banana", "cherry")
print(len(fruits))
print(len[fruits])
print(len{fruits})
The items of the set is unordered
True
False
