PCEP Section 3E: Operate with strings

Quiz
•
Computers
•
12th Grade
•
Medium
Misti McDaniel
Used 11+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to create a string in Python?
`string = "Hello, World!"`
`string = Hello, World!`
`string = 'Hello, World!`
`string = Hello, World!''`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python s = "Python" print(s[2]) ```
`t`
`y`
`h`
`o`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which escape character is used to insert a newline in a string?
`\\`
`\n`
`\t`
`\'`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you include a double quote inside a string that is enclosed by double quotes?
Use a single quote instead
Use the escape character: `\"`
Use two double quotes: `""`
It is not possible
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following creates a multi-line string in Python?
`string = "This is line 1 \n This is line 2"`
`string = '''This is line 1 This is line 2'''`
`string = "This is line 1, This is line 2"`
Both A and B
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method would you use to convert all characters in a string to uppercase?
`upper()`
`capitalize()`
`title()`
`swapcase()`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the string `s = "Programming"`, what is the result of `s[3:8]`?
`gramm`
`grammi`
`gram`
`rogra`
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Programming - Output

Quiz
•
KG - 12th Grade
15 questions
Gateway Level 3 Python Quiz 3

Quiz
•
9th - 12th Grade
18 questions
CS Unit 1, Programming part 1: Sequences

Quiz
•
9th - 12th Grade
20 questions
แบบทดสอบ Python เบื้องต้น

Quiz
•
9th - 12th Grade
10 questions
Quiz Tipe Data

Quiz
•
9th - 12th Grade
20 questions
Python Quiz (part 1)

Quiz
•
9th - 12th Grade
20 questions
Python - 1

Quiz
•
12th Grade
10 questions
Python Workshop Week 1 Review

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade