File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ #Guessing Game v.1.0
12#28- Write a program that makes the computer "think" of an integer between 0 and 5 and ask the user to try
23# find out which number was chosen by the computer. The program should write on the screen whether the user won or
34# it lost.
1112 print ('CONGRATULATIONS! You beat me.' )
1213else :
1314 print (f'I WON!!!!! I thought about the number { computer } and not in { player } !' )
15+
16+
17+ #Jogo da Adivinhação v.1.0
18+ #28: Escreva um programa que faça o computador "pensar" em um número inteiro entre 0 e 5 e peça para o usuário tentar
19+ #descobrir qual foi o número escolhido pelo computador. O programa deverá escrever na tela se o usuário venceu ou perdeu
20+ from random import randint
21+ computador = randint (0 ,5 )
22+ print ('Estou pensanem em um número de 0 a 5, tente adivinhar qual é...' )
23+ jogador = int (input ('Qual número eu pensei?' ))
24+ if jogador == computador :
25+ print ('Parabéns você acertou!' )
26+ else :
27+ print (f'Você perdeu. Eu pensei no { computador } e não no { jogador } .' )
28+
29+ #PT- Exercícios com uso de condicional.
30+ #EN- Exercises using conditional.
You can’t perform that action at this time.
0 commit comments