Generation

generate functionMon, 01 May 2023

crear un programa con while que si la entrada es: 10 20 80 el resultado debe ser: 10 20 es decir el programa debe mostrar los valores ingresados excepto el valor que si se suman hace que el numero llegue a 100

#!/bin/python3 import math import os import random import re import sys # # Complete the 'getTotalX' function below. # # The function is expected to return an INTEGER. # The function accepts following parameters: # 1. INTEGER_ARRAY a # 2. INTEGER_ARRAY b # def getTotalX(a, b): # Write your code here c = 0 d = 0 i = 0 j = 0 while i < len(a): while j < len(b): if a[i] + b[j] == 100: c += 1 d += 1 print(a[i], end=" ") print(b[j], end=" ") j += 1 i += 1 j = 0 return c, d if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') first

Questions about programming?Chat with your personal AI assistant