def main():
userInput()
calculate()
def userInput():
print("Please put in the weight of your package:")
a= input()
weight= float(a)
def calculate():
if weight <= 2:
print('Your rate is $1.10')
elif weight > 2 or weight <= 6:
print('Your rate is $2.20')
elif weight > 6 or weight <= 10:
print('Your rate is $3.70')
else:
print('Your rate is $3.80')
main()
基本的に、「userInput」モジュールのデータを「calculate」モジュールでどのように使用できるか疑問に思っていました。私は議論をパスすることを知っていますが、(そしてこれは私を狂気に駆り立てています)私の人生では、それを行う適切な方法を理解できません。引数の概念は理解していますが、実際にコードに実装することはできません。ありがとう。