Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Code Understanding
#2
nom % 2 - This operator is called modulo operator and it yields the remainder of the division.

1 == x checks if x is equal to 1.

The whole expression 1 == num % 2 checks if num is odd.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
Simple Code Understanding - by jster2001 - Mar-11-2018, 01:52 PM
RE: Simple Code Understanding - by wavic - Mar-11-2018, 01:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with simple code JacobSkinner 1 356 Mar-18-2024, 08:08 PM
Last Post: deanhystad
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 507 Nov-07-2023, 04:32 PM
Last Post: snippsat
  Code understanding: Need help in understanding dictionary code jt123 0 481 Jul-09-2023, 01:13 PM
Last Post: jt123
  New to python/coding Need help on Understanding why this code isn't working. Thanks! mat3372 8 1,781 May-09-2023, 08:47 AM
Last Post: buran
  help me simple code result min and max number abrahimusmaximus 2 941 Nov-12-2022, 07:52 AM
Last Post: buran
  Simple encoding code ebolisa 3 1,482 Jun-18-2022, 10:59 AM
Last Post: deanhystad
  How would you (as an python expert) make this code more efficient/simple coder_sw99 3 1,827 Feb-21-2022, 10:52 AM
Last Post: Gribouillis
  Understanding a piece of code Michael1 4 1,442 Jan-20-2022, 07:14 PM
Last Post: Michael1
  Simple code question about lambda and tuples JasPyt 7 3,396 Oct-04-2021, 05:18 PM
Last Post: snippsat
  My simple code don't works !! Nabi666 1 1,628 Sep-06-2021, 12:10 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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