how to print index of letter
str1 = "w3resource"
for index, char in enumerate(str1):
print("Current character", char, "position at", index )
how to print index of letter
str1 = "w3resource"
for index, char in enumerate(str1):
print("Current character", char, "position at", index )
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us