I just started coding today and I'm trying to write a simple program to add vectors. So far I have
VectorAx= input("What is the x component of Vector A?")
VectorAy= input("What is the y component of Vector A?")
VectorBx= input("What is the x component of Vector B?")
VectorBy= input("What is the y component of Vector B?")
VectorC= "[%s,%s]" % (VectorAx + VectorBx, VectorAy+VectorBy)
print (VectorC)
When I run the script everything works but the inputs aren't treated like numbers.
For example, if VectorAx=1
, VectorAy=6
, VectorBx=3
and VectorBy=2
, VectorC
should be [4,8]
, but instead it is displayed as [13,62]
.