How can I fix index error in my code ??🤔 | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 3
13th Jan 2022, 7:31 AM
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱 - avatar
4 Antworten
+ 6
Here is a simple example. You're welcome. a1 = input('Enter your name') for i in range(len(a1)): print("\n"+a1[i]+' '+'comes in your name = '+' '+str(a1.count(a1[i])))
13th Jan 2022, 7:54 AM
Simba
Simba - avatar
+ 5
The reason it raises index error is because of conditions. It says, input should contain minimum 10 characters to run without any errors. Try using a for loop to solve this issue.
13th Jan 2022, 7:43 AM
Simba
Simba - avatar
+ 3
Yeh ... I have to cover this topic then i will try ...😅 I am learning while loop next for loop then i will try to solve .. this issue... Thanks for this suggestion.... I have to complete these topics...
13th Jan 2022, 7:47 AM
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱 - avatar
+ 2
Yes This one is easy to understand... Simba
13th Jan 2022, 7:57 AM
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱
𝑺𝑯𝑼𝑩𝑯𝑨𝑴 𝑹𝑨𝑱 - avatar