School Project, Need Help Fast!

Richard Blackwood richardblackwood at cloudthunder.com
Tue Oct 12 18:18:26 EDT 2004


Gavin,
    What you want to use is a dictionary instead of all of those IFs and 
ELIFs.  Do you know how to do that Gavin?  The Python Docs should help 
you with this but feel free to reply if you have any further questions.

Gavin Bauer wrote:

> Please respond ASAP, the project is due soon.
>  
> In science, we are doing a "creative mini project" about minerals. 
> People can write a song, or make a movie, etc. etc. Being the dry, 
> uncreative person I am, I chose to use my limited python knowledge to 
> create a "Mineral Program" the idea is that a person inputs a mineral 
> name, and then the program gives them all the information about the 
> mineral. At first I figured this would be easy. I would make an input 
> line for mineral. Then I would use and if statement, and a whole bunch 
> of elif statements, to give the info, here is the broken program I 
> came up with:
>  
> <SNIP>
>  
> The "a"'s would be where I would put all the mineral information. I 
> figured I'd get the program straight before I did research. The "press 
> enter to exit" thing is because my DOS shuts off the second it 
> finishes computing, which leaves me without seeing the final 
> information. I would love it if someone knew how I could change my Dos 
> preference, but I would be pushing my luck to get a response in time 
> at all.
>  
> Thanks a lot   -Gavin





More information about the Python-list mailing list