Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Can someone tell me what's the wrong here ??

why it keeps print else statement many times ??

when i input the name it should print the name and the phone number only one time, but #it keeps print else statement

def main(): listPeopleNum = ['Toot','Steve','Ben','David','Angela','Josh', 'Jhon'] listPhoneNumers = ['789-5634','863-7563','758-1234','555-5489','044-6666','333-0000','911-6111'] inputDataEntry = input("Please input your friend full name ") for i in range(len(listPeopleNum)): if inputDataEntry == listPeopleNum[i]:
print(listPeopleNum[i], listPhoneNumers[i]) else: print('The name was not found')

main()