Write a recursive function named get_max_ascii(word) which takes a string as a parameter and returns the maximum ASCII c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Write a recursive function named get_max_ascii(word) which takes a string as a parameter and returns the maximum ASCII c

Post by answerhappygod »

Write A Recursive Function Named Get Max Ascii Word Which Takes A String As A Parameter And Returns The Maximum Ascii C 1
Write A Recursive Function Named Get Max Ascii Word Which Takes A String As A Parameter And Returns The Maximum Ascii C 1 (94.96 KiB) Viewed 58 times
Write A Recursive Function Named Get Max Ascii Word Which Takes A String As A Parameter And Returns The Maximum Ascii C 2
Write A Recursive Function Named Get Max Ascii Word Which Takes A String As A Parameter And Returns The Maximum Ascii C 2 (125.76 KiB) Viewed 58 times
IN PYTHON
Write a recursive function named get_max_ascii(word) which takes a string as a parameter and returns the maximum ASCII code of the letters in the parameter string. For example, the following code: print(get_max_ascii('abc')) #a = 97, b = 98, c = 99 = produces 99 Note: this function has to be recursive; you are not allowed to use loops to solve this problem. You can assume that the parameter string is not empty. You may find the ord() function is helpful. For example: Test Result print(get_max_ascii('This is a Test')) 116 print(get_max_ascii('T')) 84

Consider some mathematical function f defined such that f(1)=3 if(n)= f(n-1)+2) Write a python function evaluate_f(number) which takes an integer as a parameter and computes the tuple (f(n), k) where k is the number of recursive function calls required to compute f(n). Note that the number of recursive function calls does not include the initial function call, e.g. for f(0) the number of recursive function calls is zero (base case, so result is returned without recursive call) and for f(1) the number of recursive function calls is one (recursive call of f(-1)). You can assume that all input to the function will be an integer >= 1. This function has to be recursive; you are not allowed to use loops to solve this problem! For example: Test Result val = evaluate_f(3) (7, 2) print(val) (5, 1) val = evaluate_f(2) print(val) val = evaluate_f(4) (9, 3) print(val) val = evaluate_f(8) (17, 7) print(val)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply