showing result nothing | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

showing result nothing

def calculate_area(b=5,h=6,shape="triangle"): if shape=="triangle": area=1/2*(b*h) elif shape=="rectangle": area=b*h else: print("***error") area=none return area

1st Mar 2020, 1:29 PM
Tauhid Anwar
Tauhid Anwar - avatar
2 Antworten
+ 4
Just do print(calculate_area(5,6,"triangle")) The return function returns value but it doesn't print it. You have to use print() for output. #Typo fix
1st Mar 2020, 2:56 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Just do print(claculate_area(5,6,"triangle")) The return function returns value but it doesn't print it. You have to use print() for output.
1st Mar 2020, 1:36 PM
Utkarsh Sharma
Utkarsh Sharma - avatar