Issue
I am simply attempting to define a variable in Python. I am using Spyder and in the variable explorer, the defined variable "V0Z" does not show up at all. There is no error message that appears and I double checked my math by plugging in the definition into Wolfram Alpha and it gives me a real number (1.5E+7). Why is Python refusing to acknowledge it?
Code:
import numpy as np
MirrorAngle = 30
V0X = 1E7
MirrorAngleRad = MirrorAngle*(np.pi/180)
V0Z = (np.abs(V0X)/np.abs(np.sin(MirrorAngleRad)))*(1 - np.sin(MirrorAngleRad)**2)
Solution
Spyder's Variable Explorer doesn't show all-uppercase variables by default. You can change this in the hamburger menu on the pane, just uncheck the box to hide those variables:
The likely reason all-caps variables are hidden by default is that many style guides recommend all-caps for constants, so they'll never change during the lifetime of a program. That would make monitoring them in the variable explorer pretty pointless.
Answered By - Blckknght
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.