# Triangle program # N1 = base and N2 = height N1 = int(raw_input("Enter number: ")) N2 = int(raw_input("Enter number: ")) print (N1*N2)/2.0 # Rectangle program # N1 = base and N2 = height N1 = int(raw_input("Enter number: ")) N2 = int(raw_input("Enter number: ")) print N1*N2 # Pentagon program # N1 = Height N2 = Side N1 = int(raw_input("Enter number: ")) N2 = int(raw_input("Enter number: ")) N3 = N1/2.0 N4 = N3*N2 N5 = N4/2.0 N6 = N5*6.0 print N6 # Hexagon program # N1 = Height and N2 = Side N1 = int(raw_input("Enter number: ")) N2 = int(raw_input("Enter number: ")) N3 = N1/2.0 N4 = (N3*N2)/2.0 N5 = N4*6.0 print N5 # Septagon program # N1 = Height N2 = Side N1 =
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question