Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
find nearest number
#8
(Aug-26-2019, 08:24 PM)d3fi Wrote: But for me this is an achivement. Cant get my arms down

Would your arms be up if we just gave you the code?

Now, here's how I might have done it:

vaegt = int(input('Hvad vejer patienten? '))
remainder = vaegt % 5
vaegt -= remainder
if remainder > 2:
    vaegt += 5
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
find nearest number - by d3fi - Aug-26-2019, 01:22 PM
RE: find nearest number - by ichabod801 - Aug-26-2019, 02:20 PM
RE: find nearest number - by d3fi - Aug-26-2019, 02:26 PM
RE: find nearest number - by ichabod801 - Aug-26-2019, 02:34 PM
RE: find nearest number - by d3fi - Aug-26-2019, 03:17 PM
RE: find nearest number - by ndc85430 - Aug-26-2019, 03:54 PM
RE: find nearest number - by d3fi - Aug-26-2019, 08:24 PM
RE: find nearest number - by ichabod801 - Aug-26-2019, 09:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing a cycle to find the nearest point from the array Tysrusko 0 223 May-10-2024, 11:49 AM
Last Post: Tysrusko
  find the sum of a series of values that equal a number ancorte 1 567 Oct-30-2023, 05:41 AM
Last Post: Gribouillis
  Get numpy ceil and floor value for nearest two decimals klllmmm 4 1,430 Jun-07-2023, 07:35 AM
Last Post: paul18fr
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,534 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  compare and find the nearest element ? mr_gentle_sausage 4 1,161 Jan-15-2023, 07:11 AM
Last Post: DPaul
  Find if chain of characters or number Frankduc 4 1,873 Feb-11-2022, 01:55 PM
Last Post: Frankduc
Question Help to find the largest int number in a file directory SalzmannNicholas 1 1,714 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  Regular expression: cannot find 1st number in a string Pavel_47 2 2,486 Jan-15-2021, 04:39 PM
Last Post: bowlofred
  Rounding to the nearest eight wallgraffiti 2 2,169 Jul-15-2020, 06:05 PM
Last Post: wallgraffiti
  Find the complement of a number landlord1984 4 33,136 Feb-21-2020, 04:26 AM
Last Post: shreyaspadhye3011

Forum Jump:

User Panel Messages

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