+ 1
Arrays(python)
how do you transfer a users' input into an array? also how do you go through an array, performing an operation on each one with the other. for instance my array is (2, 3) I want to multiply 2 by 2 and 2 by 3. also multiplying 3 by 2 and 3 by 3.
5 Antworten
+ 4
arr=[]
arr.append(int(input()))
arr.append(int(input()))
for x in arr:
for y in arr:
print(x*y)
+ 1
def variable(x,y):
print x*x,x*y,y*x,y*y
print int(input("print value of x"))
print int(input("print value of y"))
print (x,'*',x,x,'*'y,y,'*',x,y,'*',y,variable(x,y))
0
thank you😋
0
also
0
what if you had no idea how many numbers and what number what will you do