Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
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
8 Respostas
+ 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.
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
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
0
Y estuve atentĆ³ a todos los detalles
0
Amigo listo ya lo puede correr , muchas gracias por tu ayuda ..
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! š
0
Amigo serĆ” que me explicas ese cĆ³digo
0
Pq el valor es 6?