-4
# Tipper Program
# User enters the bill total and the program computes two amounts,
# a 15 percent tip and a 20 percent tip
print("\t\t\t ** ** ** ** ** ** ** ** ** **")
print("\n\t\t\t\t Tip Calculator")
print("\n\t\t\t ** ** ** ** ** ** ** ** ** **")
bill = input("\nPlease enter your restaurant's bill total: ")
tip_15 = bill * 0.15
tip_20 = bill * 0.20
float(print("\n\nA 15% tip for this bill comes out to ", tip_15))
float(print("\nA 20% tip for this bill comes out to ", tip_20))
input("\n\nPress the enter key to exit.")
請求書の合計数を入力してもアプリは終了します。この問題を解決するための推奨事項はありますか?このプログラムの実行に問題があります
あなたはprint文をfloatにキャストしていますか?最後の2行目と3行目から 'float()'を削除してください – AK47
一般的なヒント: 'cmd.exe'(Windowsを想定)からプログラムを実行してください。ダブルクリックするだけでエラーが発生するとすぐに終了し、エラーメッセージを読むことができなくなります。 – Blorgbeard
@Blorgbeard:最後に 'input(" \ n \ n終了するにはEnterキーを押してください。) 'しませんでしたか? – martineau