Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- email = input()
- while True:
- data = input()
- if data == 'Complete':
- break
- data = data.split()
- command = data[0]
- if command == 'Make':
- command_2 = data[1]
- if command_2 == 'Upper':
- email = email.upper()
- print(email)
- elif command_2 == 'Lower':
- email = email.lower()
- print(email)
- elif command == 'GetDomain':
- last = int(data[1])
- domain = email[-last:]
- print(domain)
- elif command == 'GetUsername':
- if '@' in email:
- symbol = email.index('@')
- user = email[:symbol]
- print(user)
- else:
- print(f'The email {email} doesn\'t contain the @ symbol.')
- elif command == 'Replace':
- char = data[1]
- email = email.replace(char, '-')
- print(email)
- elif command == 'Encrypt':
- new = [str(ord(letter)) for letter in email]
- print(f'{" ".join(new)}')
Advertisement
Add Comment
Please, Sign In to add comment