part 2 16. Complete the function my_mathi), this program accepts a positive integer and a plus sign or you. After that i

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

part 2 16. Complete the function my_mathi), this program accepts a positive integer and a plus sign or you. After that i

Post by answerhappygod »

Part 2 16 Complete The Function My Mathi This Program Accepts A Positive Integer And A Plus Sign Or You After That I 1
Part 2 16 Complete The Function My Mathi This Program Accepts A Positive Integer And A Plus Sign Or You After That I 1 (36.73 KiB) Viewed 23 times
part 2 16. Complete the function my_mathi), this program accepts a positive integer and a plus sign or you. After that it will add or multiply each digit together as in the example in the program -function my math) retums the sum of each digit together. If the user enters the ampersand function my math) returns the product of the individual digits together. It the disser enters a maribor The function my math ) retums 1 it the user did not enter a + or Let's say the went to or more digits of a poteger note - The mark" indicates the beginning of the line underlined Displays user input Running example 1 Input positive integer and operator [+ or ): 123 Result: Example run 2 >input positive integer and operator (+ or *); 456.. >Result: 120 Example of day 3 >Input positive integer and operator (tor): 123/ Sinvalid operator defmy_mathinteger, operator) def main Integer, operator input'input positive integer and operator (tor"): ") split result = my_mathinteger, operator) if result 1 printif Result result else: print"Invalid operator") main()
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply