nicoobe
July 25th, 2010, 09:06 PM
Hello everybody, my problem is the following:
Imagine I am making a script to manage a Hotel and the first time the script runs I want to ask the user how many rooms do his Hotel have and after that create one object per room.
It will be something like this:
class room(self)
def __init__(self):
print "Created!"
NumberR = ("How many rooms does it have your Hotel? ")
Counter = 1
while Counter <= NumberR:
"Room",Counter = room()
Counter = Counter + 1
As you must see it doesnt works! Please Help
How would you do it?
Imagine I am making a script to manage a Hotel and the first time the script runs I want to ask the user how many rooms do his Hotel have and after that create one object per room.
It will be something like this:
class room(self)
def __init__(self):
print "Created!"
NumberR = ("How many rooms does it have your Hotel? ")
Counter = 1
while Counter <= NumberR:
"Room",Counter = room()
Counter = Counter + 1
As you must see it doesnt works! Please Help
How would you do it?