Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE_120 Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you. Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve. Question-3: Write a function name randValues0to9 that takes a string from the user as an argument and generates a random

CSE_120

Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you.

Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve.

Question-3: Write a function name randValues0to9 that takes a string from the user as an argument and generates a random integer between 0 to 9. To generate a random value you need a seed. As your range is 0 to 9, by doing seed%(9+1), you will get a random value between 0 to 9.

To generate the seed, you need to count the number of vowels and consonants in that argument. If the vowels are less in number than the consonants, then your seed will be, seed = no_of_vowelsno_of_consonants+21. Otherwise, your seed will be, seed = no_of_vowelsno_of_consonants+57 ================================================ Function Call1: randValues0to9("H@#ello Pe3ter!!")

Sample Output1: Vowels: 4 Consonants: 6 Seed: 45 Random value: 5

Explanation1: In H@#ello Pe3ter!!: string, there are 4 vowels and 6 consonants. So the vowels are less in number than the constants and the seed is, seed = no_of_vowelsno_of_conostants+21 => seed = 46+21 = 45 As your seed is 45, your random value is 45%10 = 5

================================================ Function Call2: randValues0to9("Ayeeeeeeeeeeeee lmao")

Sample Output2: Vowels: 16 Consonants: 3 Seed: 105 Random value: 5

Explanation2: In Ayeeeeeeeeeeeee lmao string, there are 16 vowels and 3 consonants. So the vowels are more in number than the constants and the seed is, seed = no_of_vowelsno_of_conostants+57 => seed = 163+57 = 105 As your seed is 105, your random value is 105%10 = 5

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 purpose of sensate focus.

Answered: 1 week ago

Question

You have to agree that 50,000,000 U.S. citizens cannot be wrong.

Answered: 1 week ago