Ich schreibe ein Programm, das zu drucken soll:Wie drucke ich eine Tabelle des Alphabets in Python?
A abcdefghijklmnopqrstuvwxyz
B bcdefghijklmnopqrstuvwxyz
C cdefghijklmnopqrstuvwxyz
D defghijklmnopqrstuvwxyz
E efghijklmnopqrstuvwxyz
F fghijklmnopqrstuvwxyz
G ghijklmnopqrstuvwxyz
H hijklmnopqrstuvwxyz
I ijklmnopqrstuvwxyz
J jklmnopqrstuvwxyz
K klmnopqrstuvwxyz
L lmnopqrstuvwxyz
M mnopqrstuvwxyz
N nopqrstuvwxyz
O opqrstuvwxyz
P pqrstuvwxyz
Q qrstuvwxyz
R rstuvwxyz
S stuvwxyz
T tuvwxyz
U uvwxyz
V wxyz
X xyz
Y yz
Z z
ich den folgenden Code für das Programm geschrieben haben, aber es wird nicht gedruckt, was ich will es. Das ist, was ich für das Programm geschrieben:
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for k in range(len(alphabet)):
for j in range(len(alphabet)):
print(alphabet[j-k],end='')
print('\n')`
und druckt es aus:
abcdefghijklmnopqrstuvwxyz
zabcdefghijklmnopqrstuvwxy
yzabcdefghijklmnopqrstuvwx
xyzabcdefghijklmnopqrstuvw
wxyzabcdefghijklmnopqrstuv
vwxyzabcdefghijklmnopqrstu
uvwxyzabcdefghijklmnopqrst
tuvwxyzabcdefghijklmnopqrs
stuvwxyzabcdefghijklmnopqr
rstuvwxyzabcdefghijklmnopq
qrstuvwxyzabcdefghijklmnop
pqrstuvwxyzabcdefghijklmno
opqrstuvwxyzabcdefghijklmn
nopqrstuvwxyzabcdefghijklm
mnopqrstuvwxyzabcdefghijkl
lmnopqrstuvwxyzabcdefghijk
klmnopqrstuvwxyzabcdefghij
jklmnopqrstuvwxyzabcdefghi
ijklmnopqrstuvwxyzabcdefgh
hijklmnopqrstuvwxyzabcdefg
ghijklmnopqrstuvwxyzabcdef
fghijklmnopqrstuvwxyzabcde
efghijklmnopqrstuvwxyzabcd
defghijklmnopqrstuvwxyzabc
cdefghijklmnopqrstuvwxyzab
bcdefghijklmnopqrstuvwxyza
abcdefghijklmnopqrstuvwxyz
Ich brauche Hilfe, um herauszufinden, was ich falsch gemacht habe und was ich für den Code zu drucken tun müssen was ich drucken möchte.
beachten Sie, dass im Gegensatz zum Beispiel Länge 26 hat jede der gedruckten Zeilen Warum, glauben Sie, ist das denn? Was denkst du, zum Beispiel, Alphabet [-5]? –