subject
Computers and Technology, 28.07.2020 22:01 chy2313

With so much exciting programming on your mind, you want to solve everything with code. You decide to write a Python function to determine which is the middle number of three numbers. Write a function called find_middle to find the middle number of three numbers. Your function should take three arguments. Here is a template for you to copy and fill in: def find_middle(a, b, c): # your code here to return middle number # instead of just 0 return 0 Here are some example calls to your function: m = find_middle(4, 1, 2) print(m) Should print: 2 This example: m = find_middle(17.5, 17.5, 17.5) print(m) Should print: 17.5 This example: m = find_middle(0, 400, -400) print(m) Should print: 0 This example: m = find_middle(7, 3, -12) print(m) Should print: 3 Hint The auto-marker is expecting you to submit only your function definition. You should not include any calls to your function. Remember also that your find_middle function should return the result to the caller rather than print the result. this is my code def find_middle(a, b, c): if (a>=b and c =b and a =b and a =c): # check if a is the middle element return a # return aif a is middle else: return c # ptherwise return c print(find_middle(4, 1, 2)) print(find_middle(17.5, 17.5, 17.5)) print(find_middle(0, 400, -400)) print(find_middle(7, 3, -12))

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:10
The total cost of textbooks for the term was collected from 36 students. create a histogram for this data. $140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285 $285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320 $330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Answers: 2
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 10:50
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
What is not a type of text format that will automatically be converted by outlook into a hyperlink?
Answers: 1
You know the right answer?
With so much exciting programming on your mind, you want to solve everything with code. You decide t...
Questions
question
Mathematics, 22.10.2020 04:01
question
Mathematics, 22.10.2020 04:01
question
Chemistry, 22.10.2020 04:01