PCEP Section 3E: Operate with strings
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Misti McDaniel
Used 13+ times
FREE Resource
Enhance your content in a minute
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`
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
12 questions
ICT Computer Basics pt1
Quiz
•
10th - 12th Grade
10 questions
Interfejsy USB i bezprzewodowe oraz urządzenia wskazujące i
Quiz
•
9th - 12th Grade
12 questions
website design elements
Quiz
•
12th Grade
10 questions
ICT as Social Change
Quiz
•
12th Grade
10 questions
مراجعة الوحدة 3 ( البرمجة بواسطة المايكروبت )
Quiz
•
12th Grade
11 questions
Packet Switching and Encryption
Quiz
•
10th - 12th Grade
10 questions
HTML & Google Site Seatwork
Quiz
•
12th Grade
20 questions
Uji Pengetahuan Jaringan Komputer
Quiz
•
9th 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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
