Quiz
Untitled
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (10)
1What is the output of the following code?
valueOne = 5 ** 2
valueTwo = 5 ** 3
print(valueOne)
print(valueTwo)- A10
15 - B25
125 - CError : Invalid Syntax
- A10
2What is the output of the following code?
str = "pynative"
print (str[1:3])- Apy
- Byn
- Cpyn
- Dyna
3What is the output of the following code?
p, q, r = 10, 20 ,30
print(p, q, r)- A10 20
- B10 20 30
- CError: invalid syntax
4What is the output of the following code?
var = "James" * 2 * 3
print(var)- AJamesJamesJamesJamesJamesJames
- BJamesJamesJamesJamesJames
- CError: invalid syntax
5What is the output of the following code ?
var= "James Bond"
print(var[2::-1])- AJam
- Bdno
- CmaJ
- DdnoB semaJ
6var1 = 1
var2 = 2
var3 = "3"
print(var + var2 + var3)- A6
- B33
- C123
- DError. Mixing operators between numbers and strings are not supported
7What is the data type of print(type(10))
- AFloat
- Bint
- Cstr
- DNone of the above
8What is the datatype of the following ?
a = (1, 'John', 1+3j)
print(type(a[2:3]))- AList
- BComplex
- CTuple
- DNone of the above
9Select all the valid String creation in Python
- Astr1 = “str1”
- Bstr1 = ‘str1’
- Cstr1 = ”’str1”’
- Dstr1 = string
10What is the output of print(10 - 4 * 2)
- A2
- B12
Information
- Description
- Quiz on Untitled, created by Jessica Braganza on 24/01/2021.
- Author
- Jessica Braganza
- Language
- English
- Views
- 2
- Tags
- Rating
- No ratings yet Rate this quiz