Problem 5: (10 points)Write a Python program that asks a user for a number of days and then computes the equivalent number of years, weeks, and remaining days. You can assume that years are 365 days. For example if the user enters 746 days you should print to the screen:That is: 2 years 2 weeks and 2 days.
That is: 2 years 2 weeks and 2 days.
Problem 6: (20 points)RecallProblem 1from your very first assignment. Write a Python program that asks the user for a positive integer and then prints a message indicating whether or not the integer is prime.
# write your code here
Problem 7: (20 points)Write a python program that asks a user for 10 integers and then sorts them using the selection sort algorith we saw in class. Your algorithm should put the numbers in a list and then use nested loops, just like we saw in class, to sort the list. Do not use the the built-in Pythonsortfunction or thesortedmethod for this.
sort
sorted
Problem 8: (20 points)Write a progam that asks a user for a string and outputs the total number of vowels in the string, the total number of distinct vowels in the string, and then prints each vowel (only once) that is present in the string. So for example, if the user enters: "Mary had a little lamb", your program should print:There are a total of 6 vowels in the string. There are 3 distinct vowels in the string. They are: 'a', 'i', 'e'.
There are a total of 6 vowels in the string. There are 3 distinct vowels in the string. They are: 'a', 'i', 'e'.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here