Question: To obtain marks for the below exercises, do not use any Python built-in functions that are not in the lecture slides or class notes (such

To obtain marks for the below exercises, do not use any Python built-in functions that are not in the lecture slides or class notes (such as index or count). Instead, write your own control structures. The only built-in functions you are allowed to use are ones we learned in class such as append, len, range, print, and input.

To obtain marks for the below exercises, do not use any Python

3) Write a program that initializes a string alphas such as the below; your program then prompts the user to enter a character. Your program will search for the target character and print out the index of the first occurrence of the character in the string alphaS. If the character is in the string alphas, the program will print the index of the character in the string, and if the character is not in the string, the program will print a message that the character was not found in the string. The string can be initialized as the following: alphaS = "cmput101Fall2020A1A2" Sample runs: Enter a character: 1 The character 1 is found at index 5 in the string. Enter a character: A The character A is found at index 16 in the string. Enter a character: B The character B is not found in the string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!