+ 1

please check the description of this question for my question

please i need help, i have a formular x+y=z i take inputs for x and y and solve for z, i want to add another input n for number of x and y if number of x and y are equal, now my question,how doi make my code show inputs x and y when n =1 and x1,x2,y1,y2 when n=2 abd so on, for some reasonable values of n, i use python please

15th Jul 2021, 2:01 AM
Edeh John chinonso
5 ответов
+ 1
n= input(" how many repeats you want: ") try: n= int(n) except: n= input(" repeats only in digits: ") n = int(n) for i in range(n): sum = int(input())+int(input()) print(f'the sum is {sum}')
15th Jul 2021, 5:21 AM
Shadoff
Shadoff - avatar
0
An example would be helpful.
15th Jul 2021, 5:13 AM
minirkk
minirkk - avatar
0
ok...
15th Jul 2021, 5:20 AM
Edeh John chinonso
0
a quadratic equatiom ax^2 + bx + c = 0 we take input for a,b and c and tge code gives two answers for x. i want to plot this answers on a graph so i need more points... so i ll like to take another set of values for x and y and repeat up to 5 times so ill b having x1 to x5 and y1 to y5 and in turn ill have 10 values for z which is 2 for z1 up to z5....now i have a normal code that solves for just one instance how can i make that code solve for n where n can b one and even greater dan 1...i want the code to b able to say at the begining input n den if user input for n is 1, it says input x and y values but if user input is 2, ill like to see input x1, x2, y1,y2 and hence solves for z1 and z2 and if 3 samething input x1 x2 x3and y1 y2 y3and give an answerz1 z2 z3and so on....i hope this is clearer
15th Jul 2021, 5:29 AM
Edeh John chinonso
0
shadoff, thank you but i don't really get it
15th Jul 2021, 5:34 AM
Edeh John chinonso