NEW
Font size
WorksheetsPython Basics
Total questions: 10
Worksheet time: 5mins
Select the Data Type which is not present in Python Language
Integer
Boolean
Number
Float
String
What letter will be printed on the screen after running this code:
x = 'Python Programming'
l =x[-4:-1]
Error
ming
Prog
min
ing
The string data type is an immutable data type
True
False
word = "amazing"
For the given string if we execute word[2:5] , what would the result be?
amaz
mazi
azi
azin
For strings, the + operator represents
Concatenation
Addition
Appending
Recantation
What is the output of the following statement?
print(3 * "Hello")
Error
3Hello
Hello3
HelloHelloHellow
What will the output be from the following code?
print("Hello world!\nHello world!")
Hello world! Hello world!
Hello world!
Hello world!
SyntaxError
Hello world!
Python accepts single ('), double (") and triple (''' or """) quotes to denote strings. Which of the following is NOT acceptable Python syntax?
print('Hello World')
print("Hello World")
print('Hello World")
print(""'Hello World'"")
Is the below statement valid in Python?
x,y,z = 10,20,30
Valid
Invalid
x = input("How many days are in one year?")
print(x,type(x))
What is the output of the above command?
3 <class 'int'>
3 <class 'str'>
3 <class 'float'>
Error
