Why is this happening?? - Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
23rd Jan 2021, 4:20 PM
BrinyFlyer28795
BrinyFlyer28795 - avatar
5 Answers
0
Well, the problem were numbers in hashes, that is why it was buging. Thank for your help Abhay
24th Jan 2021, 7:34 AM
BrinyFlyer28795
BrinyFlyer28795 - avatar
+ 4
At line 54, int(letter) isn't possible, so what are you trying to achieve with this? If you need ascii value of that letter then you need to use ord() function : ord(letter)
23rd Jan 2021, 4:26 PM
Abhay
Abhay - avatar
0
Why isn't it possible? Letter is variable. I don't need ascii value. There is an int so I can then index it, because with str it isn't possible.
23rd Jan 2021, 4:59 PM
BrinyFlyer28795
BrinyFlyer28795 - avatar
0
BrinyFlyer28795 you can't convert a letter (say "A") to an integer, that's why the error is raised, so really it isn't possible and I was wondering if you need ascii value. To this hashes array you need to pass an index to get a particular letter but you are trying to do, hashes[int(letter say "A")] which i don't know how to interpret at all.
23rd Jan 2021, 5:20 PM
Abhay
Abhay - avatar
0
Ok, maybe variable letter should rather name string or character. All even indices in variable word will be numbers. So for example 1o3m4h1.8/4@30. So, variable letter can be only number. There isn't a problem and there isn't an error. Problem is when i want do decrypt this: 5‑7q1H1H4*7q2|1H2|8g8g7q5‑5‑0R8g7q8g603>1H3>8g1H608g600R3>0R7q608g607q0R8g2|3>3>7q1H1H4*5‑600R60607q it shows bbbbbbbbbbbbbbbbbbb#bbbbbb(bb‑bbbbb(bb‘bbbbbbbbbbbb‑bb&b‘b but it should show bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb That's the problem.
23rd Jan 2021, 6:33 PM
BrinyFlyer28795
BrinyFlyer28795 - avatar