print("hello")
def vendingMachine():
count = 0
totalCredit = 0
coinNum = int(input("how many coins would you like to enter?:"))
while count in range (coinNum):
coin = float(input("enter coin: £"))
totalCredit = totalCredit + coi
count = count + 1
print("you have £{0} in your bank.".format (round(totalCredit,2)))
print("")
print("choose your item:")
print("")
print("1.coca cola")
print("2.lucozade")
print("3.7up")
print("4.fanta orange")
print("5.pepsi")
print("6.Diet pepsi")
print("7.mountain dew")
print("8.rubicon")
print("9.Dr Pepper")
print("10.sprite")
print("")
finalCredit = totalCredit
round (finalCredit, 2)
item = int(input("enter the number for your item:"))
while item <1 or item >10:
print("this item is not available.")
item = int(input("enter the nuber for your item: "))
if item == 1:
finalCredit = totalCredit - 0.59
print ("you now have a Coca cola can, costing £0.59.")
print ("you have {0} remaining in your bank.".format (round(finalCredit,2)))
に表示されていない(F5)これが起動する:Pythonコード私はそれを実行したときのpython 3.4.2シェル
私はそれはとても完全なコードだけではなく、「ハロー現れ作るのですか>>> ================================ RESTART ===============================
>>>
hello
>>>
「PythonのIDLE 3.4.2 を使用して イムiは 感謝