Python Forum
number repeating twice in loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
number repeating twice in loop
#2
Hello,

The problem as it seems is when you use the int() function on the expression: "10 * round(after_point, 1)".

Executing the two first step of your loop, the value of "after_point" variable are so close: 0.90000 for step 1 and 0.88999 for step 2. When rounding, it will give the same value in the either cases (0.9).
Reply


Messages In This Thread
number repeating twice in loop - by JonnyEnglish - Nov-23-2019, 07:08 PM
RE: number repeating twice in loop - by bobfat - Nov-23-2019, 08:25 PM
RE: number repeating twice in loop - by ThomasL - Nov-24-2019, 09:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Music Python Script Repeating Number When Saving Facebook Photos ThuanyPK 2 147 May-13-2024, 10:59 PM
Last Post: ebn852_pan
  Why is 2/3 not just .666 repeating? DocFro 4 779 Dec-12-2023, 09:09 AM
Last Post: buran
  repeating a user_input astral_travel 17 2,410 Oct-26-2022, 04:15 PM
Last Post: astral_travel
  if else repeating Frankduc 12 2,640 Jul-14-2022, 12:40 PM
Last Post: Frankduc
  Random Number Repeating Tzenesh 5 4,114 Jan-13-2021, 10:00 PM
Last Post: deanhystad
  factorial, repeating Aldiyar 4 2,858 Sep-01-2020, 05:22 PM
Last Post: DPaul
  Is 2 a prime number? for loop & range fuction in python docs says yes, mine says no. allusernametaken 4 2,986 Nov-17-2019, 02:56 AM
Last Post: allusernametaken
  Repeating equations Tbot100 2 3,308 May-29-2019, 02:38 AM
Last Post: heiner55
  repeating for loop Kaldesyvon 5 3,897 Dec-06-2018, 08:00 PM
Last Post: ichabod801
  Repeating same number in sequence Rudinirudini 6 4,319 Oct-28-2018, 07:44 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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