Question: python For each of the following problems, you should submit a separate python file. For simplicity, in the questions below you can assume that the


For each of the following problems, you should submit a separate python file. For simplicity, in the questions below you can assume that the user will not provide invalid inputs. For examples, if prompted for an integer, the user will provide an integer and not an alphabetical string for example. 1. (5 points) Write a program to calculate the number prime numbers between 1 and m, where m is provided by the user. The following is an example of the program running Enter an integer: 55 The number of primes less than or equal 55 is 16 Process finished with exit code 0 2. (8 points) Write a program that imitates the str.find() function. Your program should ask the user for the original string at the beginning. After that it will repeatedly ask the user for the character to search for, the starting index (if empty default to 0), the ending index (if empty default to the length of the original string). Each time the program must print the index of the first occurrence of the character. The program should stop if the character is not provided (i.e., the user presses enter without writing anything). Below is a sample run of the program. Enter a string: The quick brown fox is in the empty house. Enter a character to search for: f Enter the start index: Enter the end index: Character f appears first at index 16 Enter a character to search for: f Enter the start index: Enter the end index: 15 Character f is not in the string Enter a character to search for: z Enter the start index: Enter the end index: Character z is not in the string Enter a character to search for: h Enter the start index: 10 Enter the end index: 30 Character h appears first at index 27 Enter a character to search for: Process finished with exit code 0 3. (7 points) Write a program that takes two strings and decides if the first string is less than the second. It should behave as the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
