Solution Exercise 18: position of a character in a Python string

Exercise 18

Write a program in Python that asks the user to enter a string of characters s and send back a message indicating whether the string contains the letter 'a' while indicating its position on the string. Example if the user types the string s = 'language' the program returns:
The letter 'a' is at position: 1
The letter 'a' is at position: 5

Solution




 

Younes Derfoufi
CRMEF OUJDA

2 thoughts on “Solution Exercise 18: position of a character in a Python string

Leave a Reply

Your email address will not be published. Required fields are marked *