
Week 7 - DCS2103 (Strings)
Presentation
•
Computers
•
University
•
Medium
Yasmin Basiran
Used 1+ times
FREE Resource
21 Slides • 16 Questions
1
2
3
Multiple Select
If you write your name on a sticky note and put it on a lunchbox, then peel it off and put it on a new lunchbox — does the old lunchbox magically change into the new one?
Yes
No
4
5
6
7
8
9
10
11
12
Draw
Draw the string "HELLO" as a row of boxes. Label positive indexes on top (0 to 4) and negative indexes on the bottom (-5 to -1).
13
Multiple Choice
What will "Python"[0] return?
14
Multiple Choice
What happens if you try to access "hello"[10]?
Error
None
o
" "
15
Multiple Choice
What is the result of "Python"[1:4]?
16
Multiple Choice
Which code prints "Pto"?
"Python"[::2]
"Python"[1:5:2]
"Python"[2::2]
"Python"[::3]
17
18
19
20
21
22
Multiple Choice
Which method makes the first letter uppercase and the rest lowercase?
upper()
capitalize()
title()
swapcase()
23
Multiple Choice
What will "hello world".title() return?
Hello world
Hello World
HELLO WORLD
hello world
24
Multiple Choice
Output of "banana".count("a") is:
25
Multiple Choice
What does "hello".find("l") return?
26
Multiple Choice
What will "apple,banana,cherry".split(",") return?
27
Multiple Choice
What will "-".join(["2025", "09", "23"]) return?
28
29
30
31
32
33
Multiple Choice
Which statement about Python strings is TRUE?
Strings are mutable.
Strings can be modified in-place.
Strings are immutable.
Strings are stored as arrays.
34
Multiple Choice
What happens when two variables are assigned the same short string in Python?
35
Open Ended
Imagine you are writing a password checker. How could you use isalpha(), isdigit(), and isupper() to validate a user’s password?
36
Open Ended
How would you clean and format this input string: " PYTHON is Fun! " so that it becomes "Python Is Fun!"? Which string methods would you use?
37
Thank you!
Show answer
Auto Play
Slide 1 / 37
SLIDE
Similar Resources on Wayground
33 questions
FP (AD24) - Debugging y Listas (T7 y Y 9]
Presentation
•
University
26 questions
BAHASA PEMROGRAMAN PASCAL
Presentation
•
University
32 questions
MÓDULO I - SESIÓN 02
Presentation
•
University
30 questions
Intro Python
Presentation
•
University
28 questions
IT1 Topic 2 Hardware and Software (Computer Basics) Lesson
Presentation
•
University
35 questions
M0dule2 CPE4O8
Presentation
•
University
36 questions
GDSC TU Introduction to Machine Learning and Its Applications
Presentation
•
University
32 questions
Grade 2 - p.86 to p.106
Presentation
•
KG
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Review 4
Quiz
•
3rd Grade
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
16 questions
1.1-1.2 Quiz Review
Quiz
•
9th - 12th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
11 questions
Northeast States
Quiz
•
3rd - 4th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
10 questions
Common Denominators
Quiz
•
5th Grade