全部,观众我已经解决了我最后一期的API问题我现在面临着Curl的一个问题,我尝试了很多方法,例如添加User-Agent Header等等。我想我错了,在下面我给出了我当前的代码希望你伙计们可以帮助我,通过这个代码,我可以从网络浏览器访问,发布CLI问题
print("\nHi, welcome to my program that will reverse your message")
# This bit is unnecessary. Why use the `start` variable if you're never going to
# reassign it later in your program?
#start = None
#while start != " ":
# Instead, use `while True`. This will create the infinite loop which you can
# 'continue` or `break` out of later.
while True:
var_string = input("\nSo tell me, what would you like said backwards:")
print("So your message in reverse is:", var_string[::-1])
# Prompt the user again and assign their response to another
# variable (here: `cont`).
cont = input("\nWould you like another try?")
# Using conditional statements, check if the user answers "yes". If they do, then
# use the `continue` keyword to leave the conditional block and go another
# round in the while loop.
if cont == "Yes":
continue
# Otherwise, if the user answers anything else, then use the `break` keyword to
# leave the loop from which this is called, i.e. your while loop.
else:
input("Press any key to exit")
break