import numpy as np
class FourVector:
""" This document is a demonstration of how to create a class of Four vector """
def __init__(self,ct=0,x=0,y=0,z=0):
self.a=(ct,x,y,z)
self.r=(ct,r=[x,y,z])
P0 = FourVector()
print P0.a
P1 = FourVector(ct=9,x=1,y=2,z=4)
print P1.a
P2 = FourVector(ct=99.9,r=[1,2,4])
我的代码可以正常工作P0
,P1
但不能正常工作P2
:(有人能发现我的错误吗?