Answers for "how to print index of letter"

0

how to print index of letter

str1 = "w3resource"
for index, char in enumerate(str1):
    print("Current character", char, "position at", index )
Posted by: Guest on December-14-2020
0

how to print index of letter

Current character w position at 0                                                                             
Current character 3 position at 1                                                                             
Current character r position at 2                                                                             
Current character e position at 3                                                                             
Current character s position at 4                                                                             
Current character o position at 5                                                                             
Current character u position at 6                                                                             
Current character r position at 7                                                                             
Current character c position at 8                                                                             
Current character e position at 9
Posted by: Guest on December-14-2020

Code answers related to "how to print index of letter"

Browse Popular Code Answers by Language