+ 1

Yield problem

Hello, i've just made this code(python) to random generate pokemon stats, if you dont know the sum of the stats must be <780 but my code doesnt change the stats if they re bigger than 780(im not an expert), the code is this: https://code.sololearn.com/cM5jCvDYbtv2/?ref=app

1st Sep 2017, 5:46 PM
Guido Parlatore
Guido Parlatore - avatar
1 ответ
0
First, you use variables from another function in that function. Declare them outside or in a object. Second, if you do, you will have to pass value as parameters. Third, in the second function you wrote AtkSp instead Spatk. Fourth, you don't need "yield" for a function that returns nothing. A suggestion is to just use an accumulator in your first function and call it in your while.
1st Sep 2017, 8:29 PM
myenemy