代码将输入一条语句,然后输入一个每次循环加 1 的数字,并根据语句的结尾输入“st of all”、“nd of all”、“rd of all”或“th of all”。号码。**当到达 11、12 和 13 时,它只使用“st of all”、“nd of all”和“rd of all”,而对于 11、12 和 13 应该只使用“th of all” .**
import pyautogui
import time
time.sleep(5)
number = 0
numberSuffix = ""
while True:
number += 1
if str(number).endswith("1"):
numberSuffix = "st of all"
if str(number).endswith("2"):
numberSuffix = "nd of all"
if str(number).endswith("3"):
numberSuffix = "rd of all"
if str(number).endswith("4" or "5" or "6" or "7" or "8" or "9" or "0" or "11" or "12" or "13"):
numberSuffix = "th of all"
print(str(number) + numberSuffix)
pyautogui.typewrite("Statement")
time.sleep(0.5)
pyautogui.press("enter")
time.sleep(0.5)
pyautogui.typewrite(str(number) + numberSuffix)
time.sleep(0.5)
pyautogui.press("enter")
time.sleep(0.5)
哔哔one
小唯快跑啊
Helenr
相关分类