Professional Documents
Culture Documents
Strings # 1
Strings # 1
2023-2024
1. Consider the following Lists and Strings for answering questions given below:
S1 = “8IGCSE Computer Science”
S2 = “Inventure Academy”
S3 = S2[-3: ]
Write the output produced by each of the following Python statements
print(S1[1:6]) ……………………………………………………………………………………….
print(S3.upper())…………………………………………………………………………………….
2. Daisy is a computer technician. She is responsible for making sure all new employees are given a
username to access the computer network.
The rules for creating a new username are as follows:
Step 1: The employee’s first name is entered (e.g. Keith)
Step 2: The employee’s surname is entered (e.g. Olivia)
Step 3: A username is then made up from:
The first three characters of the surname (e.g. Oli) followed by the first letter of their first name
(e.g. K)
Output: OliK
Write a program that helps Daisy create a new username for one employee and print it
3. A program is written to generate a password for a person from the username provided. The rules for
creating a password are as follows:
- It starts with a $ sign
- followed by the first two characters of the username
- followed by a # sign
- followed by the last two characters of the username
- Ends with the number of characters the username has
Write a program to input a username and create a password with the rules given above