私はコーディングに比較的慣れていないので、ここで私を助けてください。コードは 5 行目までしか実行されません。このコードは完全にばかげているかもしれませんが、冗談を言ってください。
編集: 例外はありません。何も起こりません。1 と 2 のどちらかを選択するように求めた後、コードは停止します。
print('This program will tell you the area some shapes')
print('You can choose between...')
print('1. rectangle')
print('or')
print('2. triangle')
def shape():
shape = int(input('What shape do you choose?'))
if shape == 1: rectangle
elif shape == 2: triangle
else: print('ERROR: select either rectangle or triangle')
def rectangle():
l = int(input('What is the length?'))
w = int(input('What is the width?'))
areaR=l*w
print('The are is...')
print(areaR)
def triangle():
b = int(input('What is the base?'))
h = int(input('What is the height?'))
first=b*h
areaT=.5*first
print('The area is...')
print(areaT)