how to find cross product of vector from user input using for loop

**Question:**how to find cross product of vector from user input using for loop

Repl link:

code snippet

Hi @AmitDabhi1 , welcome to the forums!
Is this a school assignment?

1 Like

:wave: Welcome, @AmitDabhi1!

Here’s a function that finds the cross product of two vectors:

def cross(a, b):
    c = [a[1]*b[2] - a[2]*b[1],
         a[2]*b[0] - a[0]*b[2],
         a[0]*b[1] - a[1]*b[0]]

    return c
2 Likes