0

¿Porque no puedo pasar el Code Coach 37.2 de Python Core?

Este es mi código: import random random.seed(int(input())) #please don't touch this lane #generate the random values for every dice dice1 = random.randint(1,6) dice2 = random.randint(1,6) print(dice1) print(dice2) Yo no veo ningún error en mi código

4th Jan 2023, 4:51 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
10 Respostas
+ 2
Yeah as said i had to delete the " = " between dice1 and rand... and write it again. It looks odd because the character size changes. Don't know how but test if it helps you. I link the version which works well in my code playground: https://code.sololearn.com/c7Aw94V0Vo23/?ref=app
4th Jan 2023, 7:07 PM
JuZip
+ 2
I tried running your code in the Coach playground and it keeps on telling me that there's indentation problem where <dice1> and <dice2> were defined. The funny thing is, the same message also pops up when the original code was used, with changes only in adding value assignment for the two variables "Your code is not running The indentation for the dice1 and dice2 variables is not correct. They should be on the same indentation level as the import statement. Try again. Fail again. Fail better."
4th Jan 2023, 5:41 PM
Ipang
4th Jan 2023, 7:01 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
+ 1
Hi Daniel, you Set the start and end points in which range you want the random numbers. Yours includes 0. The numbers in a dice are from 1 to 6
4th Jan 2023, 5:08 PM
JuZip
+ 1
Ipang It doesn't work I put the same level of indentation
4th Jan 2023, 6:03 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
+ 1
I know Daniel, I also tried, checked, and realigned indentation, and also had no luck ...
4th Jan 2023, 6:08 PM
Ipang
+ 1
Could you link your code in the text? when I paste it I get syntax error in assigning. I deleted the two = in the assignments of dice1 and dice2 and wrote it new again, also in the lines are some "invisible" spaces which I deleted, then the code runs.
4th Jan 2023, 6:12 PM
JuZip
+ 1
Julian Zimpel thanks! I was finally able to pass the code coach!
4th Jan 2023, 7:12 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
0
Julian Zimpel Sorry, but I made a mistake when copying my code, I actually wrote: random.randint(1,6) and I don't pass
4th Jan 2023, 5:22 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar
0
Julian Zimpel works!
4th Jan 2023, 7:11 PM
Daniel 😊😎😉[JS Challenger]
Daniel 😊😎😉[JS Challenger] - avatar