Skip to content

Instantly share code, notes, and snippets.

@sshehrozali
Last active June 14, 2022 16:08
Show Gist options
  • Save sshehrozali/1d50bb5b11420c299aa37b776d51b84b to your computer and use it in GitHub Desktop.
Save sshehrozali/1d50bb5b11420c299aa37b776d51b84b to your computer and use it in GitHub Desktop.
# Goal: We want to build a phonebook application
# Features: 1. Creating a Contact 2. Viewing all the Contacts
phonebook = [] # Empty list of Phonebook
saved = int(input("How many contacts you want to store? "))
print() # New-line
# I am storing 3 contacts inside my Phonebook
for i in range(saved):
contact_name = input("Contact name: ")
phonebook.append(contact_name) # Adding in Phonebook
if (len(phonebook) < 1):
print("No Contacts!")
else:
for j in range(j):
print(f"Name: {phonebook[j]}")
# print("Program ended here")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment