Python 3 - How to Create a Contact List (Input, Find, Show All List)
Wednesday, July 3, 2019
Add Comment
Python 3 - How to Create a Contact List (Input, Find, Show All List).
Create a Contact List with Python. Now, I will give you an example of a program script using the Python language to make a simple contact list. This program contains commands to enter new data, search for contact data, and display all contact data that previously inputted.
Rule Condition.
- This program allows users to enter new data.
- Contact data that can be filled in is the name and mobile number.
- The user can search for the inputted name.
- Then ordered to display all contact data lists.
Contact List Source Code.
note={}
while True:
print ("====================")
print ("select the option:")
print ("1. input name")
print ("2. find name")
print ("3. show all contact")
print ("4. exit")
print ("====================")
x=int(input("select the option:"))
if x==1:
y=input("Input name:")
z=input("Input Phone:")
note[y]=z
elif x==2:
y=input("Input name:")
print ("no HP:", note[y])
elif x==3:
for key, value in note.items():
print ("nama/HP ->", key, ":", value)
elif x==4:
break
else:
print("wrong input")
0 Response to "Python 3 - How to Create a Contact List (Input, Find, Show All List)"
Post a Comment