Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code doesnt return anything
#1
[hey, im trying to get an odd number that the number that follows it will be divisible by 243 wrote the followring but i dont get any result, please help :)

def answer3():
    i = 1
    while i < 100001:
        if i % 2 == 1:
            if (i + 1) % 243 == 0:
                return i
    i += 1


print(answer3())
Reply


Messages In This Thread
code doesnt return anything - by ofrihemo - Jun-30-2020, 07:27 AM
RE: code doesnt return anything - by Gribouillis - Jun-30-2020, 07:54 AM
RE: code doesnt return anything - by bowlofred - Jun-30-2020, 08:02 AM
RE: code doesnt return anything - by ofrihemo - Jun-30-2020, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Program doesnt return beginning bilisim19 2 936 Feb-15-2023, 06:23 PM
Last Post: Larz60+
  Run the code for some stuff it does not return me why Anldra12 3 2,873 Apr-19-2021, 02:01 PM
Last Post: Anldra12
  I have two Same Code but One of them Doesnt Work beginner721 6 3,096 Jan-22-2021, 10:56 PM
Last Post: beginner721
  python code (embedded in Redshift) to return result of the query Mel 0 2,459 Aug-24-2018, 06:12 PM
Last Post: Mel
  why doesnt the while loop run? supermane 3 3,110 Aug-04-2018, 06:01 AM
Last Post: wavic
  Why does this work and this doesnt= puruvaish24 1 2,605 May-22-2018, 03:58 AM
Last Post: scidam
  Python code doesnt run tsetsko 3 3,799 Sep-02-2017, 01:47 PM
Last Post: tsetsko

Forum Jump:

User Panel Messages

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