-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathname_phone.py
More file actions
17 lines (16 loc) · 897 Bytes
/
name_phone.py
File metadata and controls
17 lines (16 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'''Write a script that asks someone to input their first name, last name and phone number.'''
'''If the user does not type at least some characters for each of these, print "Do not leave any fields empty"
otherwise print "Thank you". (Hint: if a variable is empty, its value will be "false".)'''
'''Change the script so that the script prints "Thank you" if either the first name or the last name or the phone number is supplied.
Print "Do not leave all fields empty" otherwise.'''
'''Change the script so that only first name and last name are required. The phone number is optional.'''
accepted=False
while not accepted:
fname=input("enter first name ")
lname=input("enter last name")
phone=input("enter phone number")
if not phone or not lname or not fname:
print("donot leave any field blank")
else:
print("your response was accepted")
accepted=True