Write function where user is asked to make an entry, and the square of the entry is
Question:
Write function where user is asked to make an entry, and the square of the entry is printed. Use a while loop with a try, except, else block to account for incorrect inputs.
User will call the function once, and function will request an entry. If the entry is, valid then the function will print out the square of the entry. If not valid, then user will be prompted to the error, and asked to enter a new value.
For this exercise, a solution includes using break and continue statements as well as try,except, else block with while. You may have a different version, importance is on whether when called can your function execute as described.
Question 6: Create function that uses filter to return words from a list of words that starts with a given letter.
The function will have an input of a string, and output a list of integers. example:
find_words(['lettuce','beans','apple','cat','dog','boy','girl','chicago','type'],'b') ['beans', 'boy']
Hint: you can use a lambda function to use with filter!
I keep getting an error when I write the function out:
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young