Podrian ayudarme porfavor? :'( | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Podrian ayudarme porfavor? :'(

Tengo que resolver este problema pero con bucles y no me sale :( Se lanza un dado reiteradas veces hasta que el valor del tiro es 1. Determinar la cantidad de veces que se lanzó el dado y el puntaje acumulado, si lo que se acumula es el valor del tiro

15th Nov 2020, 5:41 AM
Jhampier Quispe
Jhampier Quispe - avatar
1 Answer
+ 1
You need to write a loop that continuously rolls a dice (random int 1-6) until it lands on 1. Keep count of how many times it's rolled and keep count of the value of each roll until it rolls a 1. Output how many rolls it took and the sum of all the dice roll values.
15th Nov 2020, 8:38 AM
Olivia
Olivia - avatar