Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
chr in Python
#4
(May-14-2019, 01:18 PM)perfringo Wrote: If you 'have tried everything' then maybe you can share your results with us.

Using old-school paper and pencil can help to understand logic (customer number in parentheses)

A 0 1 2 3 4 -> (1)A0, (2)A1, (3)A2, (4)A3, (5)A4
B 0 1 2 3 4 -> (6)B0, (7)B1, (8)B2, (9)B3, (10)B4
/../

I think you can spot the pattern. You should ask yourself: what should I do to get from 7 (customer number) B1 (block and floor).

I thought that I will have a variable set to 64.
Then from 1-5 I will get 1 and add it to 64 to get 65(A)
Then from 6-10 I will get 2 and add...

But I am getting 1 from 1-4 and 2 from 5-9.
Multiples of 5 are causing problems. I have tried fllor division, remainders.. but nome of it works.
Reply


Messages In This Thread
chr in Python - by DarkCraftPlayz - May-14-2019, 01:01 PM
RE: chr in Python - by perfringo - May-14-2019, 01:18 PM
RE: chr in Python - by DarkCraftPlayz - May-14-2019, 01:34 PM
RE: chr in Python - by perfringo - May-14-2019, 01:40 PM
RE: chr in Python - by DarkCraftPlayz - May-14-2019, 04:01 PM
RE: chr in Python - by SheeppOSU - May-14-2019, 01:20 PM
RE: chr in Python - by michalmonday - May-14-2019, 01:40 PM
RE: chr in Python - by perfringo - May-14-2019, 08:35 PM
RE: chr in Python - by DarkCraftPlayz - May-15-2019, 12:20 AM

Forum Jump:

User Panel Messages

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