Question: Write a Python program to get a string from the user, find the position of the second a in the string (either 'a' or

Write a Python program to get a string from the user, find the position of the second a in the string (either 

Write a Python program to get a string from the user, find the position of the second a in the string (either 'a' or 'A' is OK), and print the position of it (e.g., the position of the first character is 0, the position of the second character is 1, and so on). If there are less than two a's, print -1 to indicate the second e is not found. In case the second e is found, print the substring after the second a. Input: a string. Output: The position of the second a in the string, the subsequent string following the second a. The prompt should be "Please enter a string: If the second a is found, the output should be formatted as "{:d) {:s}" Otherwise, the output should be NOTE: you should strictly follow the prompt/output format to get full marks. Functions like "find()" are strictly forbidden. You should use loops to deal with the characters one by one. Examplel (The contents highlighted by brown ink are inputs from the user): Please enter a string: This is for string -1 Example2 (The contents highlighted by brown ink are inputs from the user): Please enter a string: All about strings 4 bout strings

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is my solution def findsecondastring Finds the position of the second a in the string Args stri... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!