Python 6.3 : Exercise : Addition
We will continue our learning and here we will ask a question to the user, through the question function and draw two numbers at random, that is to say a and b, we will choose them in a random way calculate a and b, and check if the answer is correct or not. Well we return in some minute for the correction Concerning the correction, we are going to create the function def here by making def question parenthesis which takes nothing in interior parameters we will have a= randon point randint it takes as parameters the min and max number, I copy that if I paste, I change this value into b and then I ask my question through the answer dash str equals input Calculate percentage s plus percentage s equals percentage comma bracket b and then I go to convert the answer str I put answer dash int equals answer I check int by doing if answer int equals a plus b 2 points print correct answer else print incorrect answer and I will call the function question I will launch my code 7 correct answer I raise 3 incorrect answer so everything works normally. Well that was all for this video, we say to ourselves very soon for a next continent the exercise to ask several questions.