InformáticaBásico1 respuestas

Ayuda por favor con Python, no se puede utilizar print, solo return?

Ayuda por favor con Python, no se puede utilizar print, solo return. No puedo solucionar estos errores de estos 2 ejercicios doy 50 puntos!

4AnnaLiz8200

Mejor respuesta

Alexandrapluas131

0

Def ocurrencias(string) : string = list(string) ceros = 0 unos = 0 r = 0 for i in range(0, len(string)) : if(string[i] = = "0") : ceros + = 1 else : unos + = 1 r = unos - ceros return r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

import math

def promedio_std(lista) : x = 0 y = 0 for i in range(0, len(lista)) : x = x + int(lista[i]) x = x / len(lista) for h in range(0, len(lista)) : y = y + pow((lista[h] - x), 2) y = y / len(lista) y = math.

Sqrt(y) return(x, y)

Pruébalas y me dices.