Issue
I have a problem. I want to print a part of ASCII-Table. I mean it like this: I give first number - for Example 40 - and last number - let's say 100 and it print me number form 40 to 100. Including 40 and 100.
I got this so far:
def dectohex2(beg,end):
print('{0:x}'.format(int(beg))," ", chr(beg))
print('{0:x}'.format(int(end))," ", chr(end))
But I'm not sure what to put between those, to print other numbers.
Solution
Use a for
loop over the range between beg
and end+1
:
def dectohex2(beg,end):
for i in range(beg, end+1):
print('{0:x}'.format(int(i))," ", chr(i))
Answered By - jh314 Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.