Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python 3+ for Question P5.9 Instructions: Use one main() to call each of the functions you created. Only use one value of r and

Using Python 3+ for Question P5.9

Instructions: Use one main() to call each of the functions you created. Only use one value of r and h for all the function. Ask the user for the r and h in the main() as an input, and h for all the functions. You should put the functions for areas in a separate file. image text in transcribed

For example, firstDigtec7ze Write a function e digits n) (returning the number of digits in the argument returning the last digit of the argument) is 1,1astDec2) is 9, and igitsC12) is 4 def middle(string) that returns a string containing t odd, or the two middle characters if returns "dd" a string containing the midle in le character in string if the length of string is is even. For example, middeC"nide") P5.5 Write a function def repeat(string, n, delim) that returns the string string repeated n times, separated by the string de'lte. For example, repeat("ho", 3, ". ") returns "ho, ho, ho. P5.6 Write a function def countVowe1s(string) that returns a count of all vowels in the string string. Vowels are the letters a, e,i,o, and u, and their uppercase variants .. P5.7 Write a function def countWords(string) that returns a count of all words in the string string. Words are separated by spaces. For example, countwords("Mary had a little 1amb") should return 5. It is a well-known pheno words have two characters flipped, provided the first and last letter of each word are not changed. For example, "P5.8 menon that most people are easily able to read a text whose I dn'ot gvie a dman for a man taht can olny seplla wrod one way. (Mrak Taiwn) Write a function scramble (word) that constructs a scrambled version of a given word, randomly flipping two characters other than the first and last one.Then write a program that reads words and prints the scrambled words. Write functions def sphereVolume(r) def sphereSurface(r) def cylinderVolume (r, h) def cylinderSurface(r, h) def coneVolume(r, h) def coneSurface(r, h) that compute the volume and surface area of a sphere with radius r, a cylinder with a circular base with radius r and height h, and a cone with a circular base with radius r and height h. Then write a program that prompts the user for the values of r and h, calls the six functions, and prints the results. P5.10 Write a function def readFloat (prompt)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe the types of power that effective leaders employ

Answered: 1 week ago

Question

Describe how leadership styles should be adapted to the situation

Answered: 1 week ago