Skip to content

Python #21418

Answered by Wabri
simon14789 asked this question in General
Python #21418
Jan 12, 2019 · 10 comments · 2 replies
Discussion options

You must be logged in to vote

The code write like this cannot work, the for loop need spaces. Something like this:

letter = ['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',' ']
number = [8,26,13,4,4,3,26,0,26,5,14,17,4,8,6,13,26,5,17,8,4,13,3]
message = ""

for i in number:
message += letter[i]

Another thing you need to print the output otherwise it will not print anything:

letter = ['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', ' ']
number = [8, 26, 13, 4, 4, 3, 26, 0, 26, 5, 14, 17, 4, 8, 6, 13, 26, 5, 17, 8, 4, 13, 3]
message = ""

for i in number:
message += letter[i]

print(me…

Replies: 10 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@HenryVince
Comment options

Comment options

You must be logged in to vote
1 reply
@rizem441
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants