TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'


Joined
Oct 2, 2022
Messages
3
Reaction score
0
a=input().split()
e=[]
z=[]

e=[a[0],a[1]]
a=int(a[2])
x=0
for i in range(a):
a=input().split()
e.append(a)

print(e)
x1=int(e[0])
y1=int(e[1])
x2=int(e[2])
y2=int(e[3])
for i in x:
if x2-x1>0:
z.append("D")
x1=x2
y1=y2
y2=y2+2
x2=x2+2
elif x1-x2<0:
z.append("I")
x1=x2
y1=y2
y2=y2+2
x2=x2+2
if y2-y1<0:
z.append("B")
x1=x2
y1=y2
y2=y2+2
x2=x2+2
if y2-y1>0:
z.append("A")
x1=x2
y1=y2
y2=y2+2
x2=x2+2
else:
x1=x2
y1=y2
y2=y2+2
x2=x2+2
print(z)
 
Ad

Advertisements

Joined
May 11, 2022
Messages
58
Reaction score
5
firstly, you need to use the code brackets to have proper indenting, highlight your code with proper indent and then click the </> button.
so it seems the key part of your code is the following
Code:
a=input().split()
e=[]
z=[]

e=[a[0],a[1]]
a=int(a[2])
x=0
for i in range(a):
   a=input().split()
   e.append(a)

print(e)
x1=int(e[0])
y1=int(e[1])
x2=int(e[2])
y2=int(e[3])

in one of the int( ) functions, you have a list and shouldn't have. i would need to see what you're inputting for the first input( ) call, and all the subsequent ones covered by the for loop.
 
Joined
Oct 2, 2022
Messages
3
Reaction score
0
Okay so is a program that checks the change in a coordinates the first one have three the two coordinates and the number of movements;
Ex
1 1 3
1 2
0 1
0 2
PD thank you for helping me
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top