I cannot initialize class in python -
i have class flight, , i'm trying initialize it, have syntax error in
print x=flight(flightfrominput='nebrasca')
this content of example file
class flight: flightfrom = none flightto = none departuredate = none arrivaldate=none airline=none serviceclass=none departureairport = none arrivalairport=none #---------------------------------------------------------------------- def __init__(self,flightfrominput): self.flightfrom = flightfrominput print x=flight(flightfrominput='nebrasca')
what wrong code?
you should write
x = flight(flightfrominput='nebrasca') print x
Comments
Post a Comment