NEW
Font size
WorksheetsString Quiz
Total questions: 15
Worksheet time: 8mins
Which method can be used to remove any whitespace from both the beginning and the end of a string?
trim()
strip()
len()
replace()
What is a correct syntax to return the first character in a string?
x = "Hello"[0]
x = sub("Hello", 0, 1)
x = "Hello".sub(0, 1)
All of the above
What is the correct syntax to output the type of a variable or object in Python?
print(typeof(x))
print(typeOf(x))
print(type(x))
print(typeof x)
Which one does take you to next line?
\t
\n
\'
Print output.
x=”CHAMPION”
print(x[5])
C
A
I
P
Which method can be used to calculate length of list:
len()
string()
count()
remove()
What in programming language are like something which gets active or gets task done when called
Functions
Set
Tuple
Dictionary
What is the output of Name = print('Dave")
dave
"Dave"
Syntax Error
Dave
Find the output of the following code:
>>>str1='Save Soil'
>>>str1.isalnum( )
Save Soil
True
False
Predict the output:
>>>str1="Rajathi Raja"
>>>print(str1.count('Raja'))
1
2
Error
Raja
Find the output of the given Python program?
a = 25
if a < 15:
print("Hi")
if a <= 30:
print("Hello")
else:
print("Know Program")
Hi
Hello
Know Program
Compiled Successfully, No Output.
Variable names can start with...
...only capital letters.
...any number, letter or an underscore (_).
...any letter or symbol.
...any letter or an underscore (_).
