2016-10-16 5 views
-2

私のpythonコードをモジュラー・パイソンに変換する際に問題が発生しました。誰か助けてくれますか?pythonコードをモジュラー・パイソンに変換する

keep_going = "y" 

while keep_going == "y": 
    sales = float(input("Enter the amount of sales: ")) 
    comm_rate = .10 

    commission = sales * comm_rate 

    print ("The commission is: ", commission) 

    keep_going = input("Do you want to calculate another commission? (Enter y for yes): ") 

main() 
+0

あなたが何を求めているのかわからない –

+0

これをモジュールにしようとしていますか? – n1c9

+0

'main()'とは何ですか?それはあなたが書いた 'while'ループですか? –

答えて

0

これはなんですか?

def main(): 
    keep_going = "y" 

    while keep_going.lower() in ['y', 'yes'],: 
     sales = float(input("Enter the amount of sales: ")) 
     comm_rate = .10 
     commission = sales * comm_rate 
     print ("The commission is: ", commission) 

     keep_going = input("Do you want to calculate another commission? (Enter y for yes): ") 

main() 
関連する問題