I was asked to create a game that makes you guess a number between 1 and 100.<\/p>\n So I had thes keypoints:<\/p>\n The main function I used was the for loops to store them as a list in a variable, where later another variable will take a random item from the list:<\/p>\n r = []<\/span> It basicly store every value of e in r as a list.<\/span><\/p>\n Then, I had to make the computer say the user if the nomber was bigger o lower than the number, I used two conditionals inside a while loop:<\/p>\n while (c != rn):<\/span> The while<\/span> is for allow the user put another values for x, the conditionals<\/span> tells the user if his number was greater or lower than the number, and the counter i<\/span> makes the number of turns the user took to win.<\/span><\/p>\n It was easy to do, and it was funny because at first, I tried to do whit a while instead a for, so I make my life easier<\/p>\n
<\/a><\/p>\n\n
<\/a><\/p>\n
\nfor e in range (1,101,1):<\/span>
\n\u00a0 \u00a0 \u00a0 \u00a0r.append(e)<\/span><\/p>\n
<\/a><\/p>\n
\n\u00a0 \u00a0 \u00a0if ( c < rn ):<\/span>
\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print (“Bigger!”)<\/span>
\n\u00a0 \u00a0 \u00a0elif ( c > rn ):<\/span>
\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 print (“Lower!”)<\/span>
\n\u00a0 \u00a0 \u00a0 c = input (“Ooops, try again “)<\/span>
\n\u00a0 \u00a0 \u00a0 c = int(c)<\/span>
\n\u00a0 \u00a0 \u00a0 i = (i + 1)<\/span><\/p>\n
<\/p>\n