- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can someone help me fix this Python Program?
The first problem u are getting in the bold portion is due to non-indent block, put one indentation there.
second problem is name variable is not defined
following is the corrected one -
print ("Come-on in. Need help with any bags?") bag=input ('(1) Yes please (2) Nah, thanks (3) Ill get em later TYPE THE NUMBER ONLY') if bag == ('1'): print ("Ok, ill be right there!") if bag == ('2'): print ("Okee, see ya inside. Heh, how rude of me? I'm Daniel by the way, ya?") name="Daniel" print (name + ": Um, Names " + name) print ("Dan: K, nice too meet ya " + name) if bag == ('3'): print ("Heh, Ya remind me of someone I know... *cough* me *cough*") print ("Oh... Nearly forgot. Names Daniel, Ya?") print (name + ": Eh... " + name) print ("Dan: Cool, I now a" + name)
Advertisements