
Python: Strings
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Dr.SL Rao
Used 8+ times
FREE Resource
Enhance your content in a minute
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()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
PYTHON_CHAPTER 2
Quiz
•
University
10 questions
PF Unit 10
Quiz
•
9th Grade - University
10 questions
ทำความรู้จักกับภาษาไพทอน
Quiz
•
University
11 questions
C Language
Quiz
•
10th Grade - University
10 questions
ÔN TẬP BÀI 16 - K10
Quiz
•
10th Grade - University
10 questions
Web-II-Loop and Function
Quiz
•
University
10 questions
Intro-Computação_3.3
Quiz
•
University
10 questions
แบบทดสอบหุ่นยนต์ระดับกลางเบื้องต้น
Quiz
•
6th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
