How to create an Object with multiple properties of the same name?

Python class - Have user name object in the class and print it?

  • I need to create a python application that uses a class. When I make an object from that I want to to get user's input to name the object. Then output the name of the object to ...show more

  • Answer:

    >> I guess all your prof cares about is that you know the bare >> mechanics of setting up a class. Well, that's not rocket science. >> You'll be naming something in one scope, and then asking for >> some user input afterwards, which you know how to do. >> There will be a little bit of trickery, because your "user input" >> will be in the form of a string, and you'll have to check it to >> ensure that it is suitable to be a python name (it could be >> "$#&**(9" for all you know), and if it is, make it an alias for >> your designated piece of crap; if it isn't, reject it, and ask for >> another try. But none of this involves wizardry. > > John (gnujohn)

RTUNIFEN4ZGXHRNVO2WRMVS7II at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.