Question: 6. Ask the user for a number, then a word, and then print out a phrase that depends on the number and the word. You

 6. Ask the user for a number, then a word, and
then print out a phrase that depends on the number and the

6. Ask the user for a number, then a word, and then print out a phrase that depends on the number and the word. You should pluralize the word by adding an 's to the end whenever they enter a number that is Oor greater than 1. In: 0 In: bat Out: O bats in: 1 In: cat Out: 1 cat In: 4 In: dog Out: 4 dogs Let's implement some more advanced rules: Words ends in: Life Becomes: ves -shes ches -sh/ch Example: life - lives bush - bushes church -> churches cactus -> cacti quy quy$ -ayloyleyluy -aysloysleysluys toy -> toys key -> keys way -> ways fly -> flies hat ->hats everything else add-5 To do this, you'll have to use string slicing. The following table provides the shortcuts for common tools you might need: word = 'computerz" print(word:5]) #prints "compu" print word[:-1]) # printscomputer" print(word(4:]) #prints "uterz" print word (-3:]) # prints "erz" 7. Write a function is prime that takes in one integer as an argument and determines whether it is a prime number or not. As a reminder, a prime number is only divisible by 1 and itself. is_prime should return True or False depending on whether the number is prime

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!