Skip to content

calculator.py#34

Open
EstefaniaGallegos616 wants to merge 1 commit intoJarsa:testingfrom
EstefaniaGallegos616:patch-5
Open

calculator.py#34
EstefaniaGallegos616 wants to merge 1 commit intoJarsa:testingfrom
EstefaniaGallegos616:patch-5

Conversation

@EstefaniaGallegos616
Copy link

class CalculatorClass(object):
#class Lista:
lista = []
sum = 0
def llenarlista(self):
x= int (input("Ingrese Tamaño De La Lista:"))
for i in range(x):
#llenar lista
self.lista.append(int(input("Ingrese Numero:")))
#imprimir lista
for i in self.lista:
print (i)

def sumar(self):
for i in self.lista:
self.sum+= i
print ("La Suma De Los Datos Es:",self.sum)

obj = CalculatorClass()
obj.llenarlista()
obj.sumar()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant