import urllib.request
import time
def get_price():
text = page.read().decode("utf8")
where = text.find(">$")
start_of_price = where + 2
end_of_price = start_of_price + 4
price = text[start_of_price:end_of_price]
return(price)
def cheap_price():
price = get_price()
while float(price) > 4.74:
time.sleep(1)
print("$" + price)
print("buy!")
custom_setting = "End"
return(custom_setting)
custom_setting = input("Do you want custom setting?(Y/N)")
while custom_setting == "Y" :
custom_setting = input("Do you want price now?(Y/N)")
if custom_setting == "Y":
price = get_price()
print("$" + price)
else:
cheap_price()
custom_setting = cheap_price()
while custom_setting == "N" :
cheap_price()
custom_setting = cheap_price()
print("Perfect End")
작동은하는데 에러는 안뜨는데 최종적으로 Perfect End나와야는데 안뜨네요.
게다가 N분기로가면
가격도 두번나오고 한번나와야되는데 여러번나오는데 custom_setting = "End"로 함수에서 변수로 return이 지정되지도않고요.
- dc official App
댓글 0