+ 1

No output. Need assistance.

Hi, I'm new to code in general and have reached a block in my learning. I've written something that allows me to pick a specific shape (right now it's Triangle and Square), and after entering the x and y dimensions, or height and width, it calculates the area. While the program is extremely simple math only the triangle area gives an output, where as the square gives "No Output." How do I fix this so that if I enter: Square 3 6 into the input box I get my answer (18.) https://code.sololearn.com/cF2VlrSlJo2t

14th Nov 2017, 6:17 PM
Will Russell
Will Russell - avatar
2 Réponses
+ 3
The reason your code didn't work is because your value of Square was used by the input on line 15. Line 18 read the 3 and failed to match.
14th Nov 2017, 7:14 PM
John Wells
John Wells - avatar