From 7451edff7692e86c5238ff7bc6659825e242a84e Mon Sep 17 00:00:00 2001 From: Sudipto Mallick <> Date: Tue, 2 Jan 2024 03:38:10 +0000 Subject: Quick backup, need to be rewritten --- python/code/3/7.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 python/code/3/7.py (limited to 'python/code/3/7.py') diff --git a/python/code/3/7.py b/python/code/3/7.py new file mode 100644 index 0000000..7a17f08 --- /dev/null +++ b/python/code/3/7.py @@ -0,0 +1,9 @@ +import sys +address = input('Enter an E-mail address: ') +if '@' not in address: + print(address, 'is not a valid E-mail address') + sys.exit(1) +at_position = address.rindex('@') +username, domain = address[:at_position], address[at_position+1:] +print('Username:', username) +print('Domain:', domain) -- cgit 1.4.1-2-gfad0