Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I NEED HELP!!!
#3
(Mar-29-2019, 11:53 AM)polloila Wrote: I can't figure out how to add and subtract from their scores according to whether they land and even or an odd number.

Please write some code and I am pretty sure there are people willing to help you.

I observed that actually you have only one problem (quoted above). Simplest way to determine whether number is even or odd is to use modulus (divides and returns the value of the remainder):

>>> 4 % 2
0
>>> 5 % 2
1
>>> if 5 % 2 == 0:
...     print('even')
... else:
...     print('odd')
...
odd
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
I NEED HELP!!! - by polloila - Mar-29-2019, 11:53 AM
RE: I NEED HELP!!! - by Yoriz - Mar-29-2019, 02:24 PM
RE: I NEED HELP!!! - by perfringo - Mar-29-2019, 02:51 PM
RE: I NEED HELP!!! - by polloila - Apr-01-2019, 07:50 PM

Forum Jump:

User Panel Messages

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