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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -