RisingCoder Full course โ†’
Day 1Day 2Day 3Day 4
๐Ÿงต
STUDENT NOTES ยท DAY 8 OF 24

Word Wizardry ๐Ÿงตโœจ

Text in Python is called a string โ€” and you can slice it, flip it, SHOUT it and stitch it like a wizard.

1Strings have superpowers (methods)

๐Ÿ
Py: The dot means "do your trick": "hello".upper() asks the string to shout itself.

2Slicing โ€” cut any piece you want

A string is a train of letters (index from 0, like lists!). Slice with [start:end]:

๐Ÿฆ‰
Professor Hoot: [::-1] is the famous reverse trick โ€” walk the string backwards. Interviews love it.

Word Wizard โ€” type any word!

upper โ†’ PYTHON  ยท  len โ†’ 6  ยท  reversed โ†’ nohtyp

3split โ€” one string becomes a list

๐Ÿค–
Bittu: This is how I read spreadsheets, CSV files, and your messy shopping lists.

4Strings never change (Bugly's favourite)

๐Ÿž
Bugly: Try to fix ONE letter of a string. Go on. Try. ๐Ÿ˜ˆ
๐Ÿ
Py: Strings are immutable โ€” frozen after birth. To "change" one, build a NEW one: "b" + s[1:].

5Quick quiz! ๐Ÿง 

What is "chai"[1]?
๐Ÿ’ก Index 0 is c, index 1 is h. Letters count from 0, just like list wagons.
What does "a-b-c".split("-") give?
๐Ÿ’ก split cuts at every "-" and hands you a LIST of the pieces.

6Your mission ๐Ÿš€

Mission 1: Ask for the user's name and print it in CAPITALS with f"HELLO {name}!".
Mission 2: Print your name reversed with [::-1]. Is it a cool secret name?
Mission 3: Take "milk,eggs,bread", split it, and print each item on its own line with a loop.

Day 8 done โ€” word wizard certified! โœจ

Next: functions โ€” write a spell once, cast it forever.

Go to Day 9: Functions โ†’

๐ŸŽฎ Or test yourself in the Python Arcade โ†’