9.1.
9 Worksheet
1. BRONZE - Read and understand the following examples. We use the #
to add comments and explain the code we are implementing.
a. How to make a string lowercase? ____
b. How to make a string uppercase? ____
c. How to capitalize a string? ____
d. How to calculate the length of a string? ____
The worksheet continues in the next page
2. SILVER – Open a python compiler and paste the code in purple
below. Implement the instruction provided in the comment.
colour = "Yellow"
#add code to output the length of the variable
name = input("What is your name: ")
#add code to change this input to uppercase letters
#OUTPUT name
activity = input("Enter a possible activity: ")
#add code to change this input to lowercase letters
#OUTPUT activity
holiday = input("Enter a holiday destination: ")
# add code to change this input to a capitalised word
#OUTPUT holiday
Add your code below:
3. GOLD – Create a Python program that generates fun names based
on user input. The program should include the following steps:
a. Ask the user to input their first name and store it in a variable
called username.
b. Use string manipulation techniques to create at least three
variations of the user's name.
i. For example:
1. All lowercase: use lower()
2. All uppercase: use upper()
3. The first letter capitalized: use capitalize()
4. Add "inator" to the end of the name:
(print(userName + "inator")) (feel free to choose other name
endings)
5. Add “The great” at the beginning of the name:
(print("The great", userName)) (feel free to choose other name
starter).
c. Add a screenshot of your work below.