String Data and Methods
✕Storing String
Question 1 of 5
- Create a variable that stores your name and display it.
- Store text
I'm learning Pythonin a variable and display it. - Store text
Ram said, "I've a pen."in a variable and display it. - Store below text in a variable (as multiline) and display it.
Dear Manager, I am on leave! Thanks - Store
\n and \t are special character. We use \ to escapein a variable and display it.
Indexing and Slicing
Question 2 of 5
- Find and display the first character.
- Find and display the character at index 8.
- Find and display the last character (using negative indexing).
- Find word
Pythonusing slicing and display it. - Find word
funusing negative slicing and display it. - Find text
lrn(i.e. only some part of textlearning) and display it. - Reverse the string and display it.
- Find sub-string that lies from 5th index till end and display it.
- Find sub-string that lies from start till 10th index and display it.
Create a variablemy_strthat storesWe are learning Python and it's fun!andGeneric functions
Question 3 of 5
- Display
HelloWorldby concatenating both strings. - Assign
greetingsvariable asHello Worldby concatenating both strings and display it. - Assign
my_strasHelloHelloHellousingstr_1repetition. - Find and display number of characters in string
my_str. - Change value of
greetingsvariable to uppercase and display it. - Change value of
greetingsvariable to lowercase and display it. - Change value of
greetingsvariable to title case and display it. - Swap the case of characters in
greetingsvariable and display it.
Create a variablestr_1that storesHello,str_2that storesWorldand:- Display
Data Check Functions
Question 4 of 5
- Check and display if
str_1has alphabetic characters only. - Check and display if
str_1has numeric characters only. - Check and display if
str_2has alphanumeric characters only. - Check and display if
str_4is empty. - Check and display if
str_3starts withabc - Check and display if
str_3ends with3 - Check and display if
str_1starts withHeand ends withlo - Remove leading and trailing
#fromstr_3and display the result - Remove leading
#fromstr_3and display the result
Assignstr_1as"Hello",str_2as"134",str_3as"##abc123##"andstr_4as" "- Check and display if
Data Manipulation & Cleanup
Question 5 of 5
- Assign
file_nameasreport_2026.pdf. Split and display file name and extension. - Store
my_dateas2026-03-05. Split it into list of year, month, day and display result - Store
my_strasPYTHON. Use join function to displayP.Y.T.H.O.N - Store
laptop_namesas['Dell', 'HP', 'Mac']. Use join function to displayDell-HP-Mac - Assign
str_1asHello, World!. ReplaceWorldwithPythonand display the result. - Assign
str_2as2026-03-01.csv. Replace-with/and display the result. - Assign
str_3asPineapple. Find at which indexapplestarts and display the result. - Assign
my_nameas your name. Count the number of vowels in it and display the result. - Assign
my_strasHello, World!. Count and display occurrence of letterlin it.
- Assign
