[Python] It wont give a proper Out (new to python) [closed]

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    It gives an unexpected error, "Magnitude of verctor A <function Magnitude_vector at 0x100220fe0>"

    Really new to python so please forgive me for triggering the pros

    import numpy as np
    def vector (X , Y, Z):
    X = int
    Y = int
    Z = int
    return np.array([X , Y, Z])


    Vector_A = np.array(input("Enter Your vector in X op Y op Z"))

    def Magnitude_vector(A):
    A = np.array([X, Y, Z])
    import math

    X = int
    Y = int
    Z = int

    L = math.atan(Y/X)
    S = math.sqrt(X*X + Y*Y + Z*Z)
    M = (S/L)
    print(M)

    print ("Magnitude of verctor A", Magnitude_vector)


    Should Give an output of 5.05 with input ([3, 4, 5])

    Continue reading...

Compartilhe esta Página