Tengo problemas con redacción | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Tengo problemas con redacción

Mi problema es que descargue el 3.8 y 3.3 y los dos me dan el mismo error de redacción no se si es mi pc o es mi redacción necesito ayuda

12th May 2020, 10:57 PM
Gabriel dominguez
Gabriel dominguez - avatar
8 Answers
+ 1
A qué se refiere con "redacción". Muestre su código y/o el error que produce. Gabriel dominguez Comprobaste si el código está bien indentado. Los espacios son importantes. Mira este código. https://code.sololearn.com/cm4DtfGE27Gf/?ref=app Además es probable que estés corriendo el código en el Shell. Si estás usando la versión oficial de Python para Windows abre el IDLE y escribe tu código ahí. Recuerda primero crear un proyecto nuevo y verificar que no aparezca ningún ">>>". Cuando termines presiona F5 para correr el código.
12th May 2020, 11:28 PM
Kevin ★
0
Hola estuve viendo algunos tutoriales donde el hacía un ejercicio de este tipo Número1=12 Número2=10 If numero1>número2: Print ("número 1 es mayor") Else: Print ("número2 es mayor ") Así tal cual lo redacto en mi Python 3.3 y también tengo 3.8 En ningúno paso de la línea del if ,cuando le doy enter corre el código mostrando errores
12th May 2020, 11:54 PM
Gabriel dominguez
Gabriel dominguez - avatar
0
Amigo ya entiendo , en este momento descargue la versión 3.3 y para entrar en el le doy en IDLE Python , enseguida me parece la hoja para empezar a programar copio y pego el código y aún así me dice error
13th May 2020, 2:00 AM
Gabriel dominguez
Gabriel dominguez - avatar
0
Y estuve atentó a todos los detalles
13th May 2020, 2:00 AM
Gabriel dominguez
Gabriel dominguez - avatar
0
Amigo listo ya lo puede correr , muchas gracias por tu ayuda ..
13th May 2020, 2:41 AM
Gabriel dominguez
Gabriel dominguez - avatar
0
res += i is the same as: res = res + i So we have res = 0 to start with and it goes within the loop. If we are printing the value 4 of the range it means there are 4 steps. So it starts: first loop: res = 0 (the value os res) + 0 (value of i) second loop: res = 0 (current value of res) + 1 (value of i on the second loop) third loop: res = 1 (current value of res) + 2 (value of i on the third loop) forth and final loop: res = 3 (current value of res) + 3 (value of i on the last loop since python counts from 0) so in the end res = 6. the confusion might be in the res = 0 since it is in the function. but remember, it is not inside the loop...so it doesn't go back to 0 on each loop. hope that was helpful! 👊
16th May 2020, 6:00 AM
Gabriel dominguez
Gabriel dominguez - avatar
0
Amigo será que me explicas ese código
16th May 2020, 6:00 AM
Gabriel dominguez
Gabriel dominguez - avatar
0
Pq el valor es 6?
16th May 2020, 6:00 AM
Gabriel dominguez
Gabriel dominguez - avatar