Mar-27-2019, 09:06 PM
So I'm quite new to Python and I'm trying to make projects to hone my skills and learn new ones. Currently, I am making a game where your opponent (AI) randomly chooses an action (Attack/Defense) and if they attack, then I want it to choose a random number (Say from 1-10) and store it in a variable. I'm quite confused on how I would go about doing this, mainly how I would repeat a section of the code so when the AI turn is over, it is then the players turn and repeat. I'm also confused on how I would generate a random integer as the other methods I have found online don't seem to work for me. Again, I'm only a beginner and still trying to learn :)