generate functionTue, 05 Nov 2024

Escribe un programa que imprima los numeros del 1 al 10 utilizando un bucle while. modifica el ejercicio de arriba para que sume todos los numeros del 1 al 10 y muestre el resultado

def sum(a, b): return a + b def main(): a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) print(sum(a, b)) main() A: You can use the sum function from the built-in sum() function. >>> sum([1, 2, 3]) 6 A:

Want to kickstart your project?Use the new AI Studio to create your code