What does the following Python Program print out?
str1 = "Hello"
str2 = 'there'
s = str1 + str2
print(s)
Python: Strings
Quiz
•
Computers
•
University
•
Medium
Dr.SL Rao
Used 8+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following Python Program print out?
str1 = "Hello"
str2 = 'there'
s = str1 + str2
print(s)
Hello
there
Hellothere
Hello there
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following Python Program print out?
x = '40'
y = int(x) + 2
print(y)
42
402
int402
x2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you use the index operator [] to print out the letter h from the following string
x = 'Python Programming Strings'
print(x[4])
print(x[h])
print(x[3])
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you use the slicing [:] to print out the letter 'gram' from the following string
x = 'Python Programming Strings'
print(x[10:13])
print(x[10:14])
print(x[9:12])
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the iteration variable in the following Python code?
for letter in 'banana' :
print(letter)
in
letter
for
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you print out the following variable in all upper case in Python?
greet = 'Hello Everyone'
print(greet.ucase())
print(greet.touppercase())
print(greet.upper())
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following string methods removes whitespace from both the beginning and end of a string?
strip()
rstrip()
strtrunc()
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
what is the output of this code?
data = 'From ArunaRao.SL@gmail.com Sat December 11 11:20:16 2020'
pos = data.find('.')
print(data[pos:pos+3])
.SL
.gma
gma
SL@
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
what is the output of this code?
print(len('banana')*7)
banana7
42
-1
banana banana banana banana banana banana banana
10 questions
Python
Quiz
•
University
10 questions
Python3
Quiz
•
4th Grade - University
9 questions
Python Quiz 1
Quiz
•
8th Grade - University
13 questions
Python Reflect
Quiz
•
8th Grade - University
10 questions
Python01
Quiz
•
University
10 questions
Python User Input Quiz
Quiz
•
6th Grade - University
10 questions
Lists review (Python)
Quiz
•
University
7 questions
ESBrotherX_Medical AI_Lecture
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade