4.3 code practice edhesive (in python 3) write a program that uses a loop to print the uppercase alphabet with the correct ASCII number next to each letter. (e.g., one line might be A 65).
Answers
Answer:
x = 64
while x >= 64 and x <= 89:
x =x+ 1
print(str(chr (x))+ "=> ASCII number is = " + str(x))
Output:
A=> ASCII number is = 65
B=> ASCII number is = 66
C=> ASCII number is = 67
D=> ASCII number is = 68
E=> ASCII number is = 69
F=> ASCII number is = 70
G=> ASCII number is = 71
H=> ASCII number is = 72
I=> ASCII number is = 73
J=> ASCII number is = 74
K=> ASCII number is = 75
L=> ASCII number is = 76
M=> ASCII number is = 77
N=> ASCII number is = 78
O=> ASCII number is = 79
P=> ASCII number is = 80
Q=> ASCII number is = 81
R=> ASCII number is = 82
S=> ASCII number is = 83
T=> ASCII number is = 84
U=> ASCII number is = 85
V=> ASCII number is = 86
W=> ASCII number is = 87
X=> ASCII number is = 88
Y=> ASCII number is = 89
Z=> ASCII number is = 90
This code is written in Python Programming Language.
We have taken a variable x and assigned value 64 because 65 is ASCII value of A and to run it in a loop so, it can print till Z along with its ASCII values.
Note=> Indentation is important.
Answer: