Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
chr in Python
#1
Question: Write a program in Python to allocate and display Block and Floor No. on the basis of Customer Number. Assuming there are 10 Blocks ('A' to 'J') with 5 floors (0 to 4) each and allocated to customers sequentially as per their Customer Number. For example: Customef no 1 gets [Block A Floor 0], Customer no 3 gets [Block A Floor 2], Customer no 7 gets [Block B Floor 1]

NOTE: This program has to be done only using arithmetic operations and type conversions (i.e., without use of if-else)

HINT: ASCII codes for 'A','B'.. are 65, 66,... & chr(65) in python is 'A'

I am new to python and this forum so I am extremely sorry if I broke any rules Big Grin

I have tried everything I can (at this stage) but I can't seem to find the logic and I am also not very familiar with chr function.

Please help me.
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