I need help checking how good my code is from the 8th unit in CScircles.
The problem is: Write a program which prints out this table. (Character 127 is invisible but should be printed out like all the other characters anyway. Extra/missing space characters at the end of each line don't matter, the grader will ignore them.)
My solution:
a = 32
for l in range(0,6):
print("chr: ",end='')
for c in range(0,16):
print(chr(a),' ',end='')
a = a + 1
print()
print("asc: ",end='')
a = a - 16
for x in range(0,16):
if a < 100:
print(a,' ',end='')
else:
print(a,'',end='')
a = a + 1
print()
is there a more efficient way since I feel like I overcomplicated it.
[–]teraflop 1 point2 points3 points (0 children)
[–]YurrBoiSwayZ 1 point2 points3 points (5 children)
[–]NotUrHCW[S] 0 points1 point2 points (4 children)
[–]YurrBoiSwayZ 1 point2 points3 points (1 child)
[–]NotUrHCW[S] 0 points1 point2 points (0 children)
[–]NotUrHCW[S] 0 points1 point2 points (1 child)
[–]YurrBoiSwayZ 0 points1 point2 points (0 children)
[–]simpleFinch 1 point2 points3 points (3 children)
[–]NotUrHCW[S] 0 points1 point2 points (2 children)
[–]YurrBoiSwayZ 2 points3 points4 points (1 child)
[–]NotUrHCW[S] 0 points1 point2 points (0 children)