Why Strings Are Used
๐ Scenario: Imagine you are creating a simple contact list app. You need to store names and phone numbers. Names are words made of letters, so you use strings to keep them.
๐ฏ Goal: You will create a dictionary with names as strings and their phone numbers. Then you will check if a name is in the list and print a message.
๐ What You'll Learn
Create a dictionary called
contacts with exact string keys and integer valuesCreate a variable called
search_name with a string valueUse an
if statement to check if search_name is in contactsPrint a message showing the phone number if found, or a not found message
๐ก Why This Matters
๐ Real World
Storing and searching names in contact lists, user databases, or any place where words identify data.
๐ผ Career
Understanding strings and dictionaries is essential for data handling in software development, customer management, and many programming tasks.
Progress0 / 4 steps