About Python, why errors? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

About Python, why errors?

#Write a Python program to find the median among three given numbers. Click to see ⤵️ https://code.sololearn.com/cU878OLzTSb2/?ref=app

18th Nov 2022, 11:16 AM
Mustakim Rahman
Mustakim Rahman - avatar
3 Answers
+ 6
It worked for me. Make sure you enter all 3 numbers on their own line. E.g. 10 12 14 OR 14 10 12 And so on...
18th Nov 2022, 11:21 AM
Ausgrindtube
Ausgrindtube - avatar
+ 6
Mustakim Rahman , if your task always takes 3 input values, the calculation of the median can also be done like: > take the input as 3 integer numbers: num1, num2, num3 > use sorted([num1, num2, num3]) > from the result of this operation take the index [1] which represents the median
19th Nov 2022, 1:28 PM
Lothar
Lothar - avatar
+ 2
Convert input into int() type as x = int( input() )
18th Nov 2022, 11:49 AM
Jayakrishna 🇮🇳