0

Help with trainer code

I don't understand, I made my code on the computer and the results are as expected, but in the trainer code of Sololearn the first letter not take and the 'z' = 'a' shows it as 'b'. It doesn't make spaces for me either and everything is fine on my computer. Any ideas? https://code.sololearn.com/cdQdeZNO637i/?ref=app

29th Apr 2020, 12:16 AM
Josshual A. Toro M.
Josshual A. Toro M. - avatar
5 odpowiedzi
0
Have you tried using a dictionary instead of lists to map the letters?
29th Apr 2020, 11:34 AM
Slick
Slick - avatar
0
No, I have only used lists. I have to try with dictionary, but my real question is why it doesn't work like it does on my computer?
29th Apr 2020, 5:04 PM
Josshual A. Toro M.
Josshual A. Toro M. - avatar
0
If you print the length of your variable 'a', you'll see its only 26 characters. Meaning the list is leaving out your empty string(the space) so it doesnt register. Still trying to see why whats causing 'b' to be printed in for 'z'. Research dictionaries and come back. This challenge will seem like a joke
29th Apr 2020, 5:16 PM
Slick
Slick - avatar
0
https://code.sololearn.com/czmeRqqsWFvS/?ref=app Run this and look at the dictonary that gets printed. THATS why 'z' gets 'b' and why your spaces dont show...because spaces turn into 'a's!
29th Apr 2020, 5:23 PM
Slick
Slick - avatar
0
I have the solution, is the ' , ' how separator.
29th Apr 2020, 5:44 PM
Josshual A. Toro M.
Josshual A. Toro M. - avatar