I want to use python to achieve the following requirements① Recite a group of 20 randomly selected words out of 100 English words every day The initial probability of each word being selected each day
- Create a list of 100 English words.
- Use the random module to select 20 words from the list.
- Set the initial probability of each word being selected to 90%.
- Use a loop to iterate through each word in the selected group.
- Display the word and prompt the user to select "memorized" or "not memorized".
- If "memorized" is selected, decrease the probability of the word being selected again within the same day by 10%. If "not memorized" is selected, decrease the probability by 5%.
- Use the datetime module and an API to get the current time in the specified time zone.
- Check if the current time minus the start time of the previous day is greater than 24 hours. If it is, start a new day of recitation and record the start time.
- Store the latest extracted probability of each word, the previous day's recitation time, the present time, and the new day's recitation start time in a TXT text file
原文地址: https://www.cveoy.top/t/topic/fonE 著作权归作者所有。请勿转载和采集!