import random
import math
money=10000
while money <=500:
    print('Hello world!')
    x=random.randint(1,100)
    ans=random.randint(1,100)
    print('当たりの数字は',ans)
    print('あなたの数字はー!')
    print(x,'でした!')
    if x == ans:
        print("ナイスー")
        money+=1000
        print('1000ゲット')
    elif abs(x-ans) <= 10:
        print('おしい!500円ゲット)
        money+=500
    else:
        print(残念…参加費500円もっていかれた)
        money-=500
    print('残り金額',money)
    answer=input('やめる?[yes/no]')
    if answer == "n" or "no":
        break
print('最終金額')
y=money-10000

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: