Python Forum
Open source project that a beginner could contribute to?
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open source project that a beginner could contribute to?
#11
This is incorrect:
if userin == 'i' or 'I':
    food_items(items)
It will always evaluate to True. To do this correctly you can do:
if userin == 'i' or userin == 'I':
or:
if userin in ('i', 'I'):
Using the lower method is better when dealing with case insensitive searches. It is best to use lower once:
userin = input('blah blah blah').lower()
if userin == 'i':
    ...
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Open source project that a beginner could contribute to? - by ichabod801 - Apr-10-2017, 04:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  My first project as a beginner lil_e 4 1,124 Feb-27-2023, 08:19 AM
Last Post: lil_e
  How do I open the Source code of a library? JaneTan 1 2,286 Aug-18-2021, 02:12 AM
Last Post: Larz60+
  Open for Python project(s) Python_User 8 3,296 Sep-10-2020, 07:45 PM
Last Post: Python_User
  Need help with this project / Beginner kurwa97 2 1,832 Nov-13-2019, 11:11 PM
Last Post: kurwa97
  Visual Studio Python 2.2 Source Project bobosamma 5 3,175 Oct-14-2019, 11:19 AM
Last Post: snippsat
  how to contribute our code/improvements to python pandas df..?? saikumarcheethirala 2 2,011 Jul-18-2019, 01:06 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020