Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- username = input()
- command = input()
- while not command == 'Sign up':
- command = command.split()
- if command[0] == 'Case':
- if command[1] == 'lower':
- username = username.lower()
- elif command[1] == 'upper':
- username = username.upper()
- print(username)
- elif command[0] == 'Reverse':
- start_index = int(command[1])
- end_index = int(command[2])
- if start_index <= len(username) and end_index <= len(username):
- print(username[start_index:end_index+1][::-1])
- elif command[0] == 'Cut':
- if command[1] in username:
- username = username.replace(command[1], '')
- print(username)
- else:
- print(f"The word {username} doesn't contain {command[1]}.")
- elif command[0] == 'Replace':
- username = username.replace(command[1], '*')
- print(username)
- elif command[0] == 'Check':
- if command[1] in username:
- print('Valid')
- else:
- print(f"Your username must contain {command[1]}.")
- command = input()
Advertisement
Add Comment
Please, Sign In to add comment