No student devices needed. Know more
21 questions
word = "amazing"
For the given string if we run word[2:5] , what would the result be?
mazi
mazin
azi
azin
Which of the following is not a valid string function?
isalphanumeric
isspace
islower
isalnum
string="HELlo"
What will be the result of string.isupper()?
What is printed by the following statement?
print("P" not in "APCSP")
True
False
Error
What is printed by the following statement?
print("A" in "APCSP")
True
False
Error
For strings, the + operator represents
Concatenation
Addition
Appending
Recantation
data = "No Way!" The expression len(data) evaluates to:
7
9
8
6
Which operator returns True if target string is somewhere in the search string; otherwise it returns False.
==
!=
in
is
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
\l
/
\\n
\n
Which is the most appropriate data type for: "13th December"
Float
Boolean
Integer
String
What will the output be from the following code?
print("Hello world!" * 2)
TypeError
Hello world world!
Hello world!Hello world!
Hello world! * 2
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!
What will the output be from the following code?
print("3+4")
7
34
3+4
SyntaxError
print("12"*3)
What would this print?
121212
36
24
12*3
Explore all questions with a free account