I see. So I'm basically creating my own dictionary within the program, that's pretty epic, I'm sure I'll learn it at some point in the book; I don't want to get writing loads of lines of codes that I have no idea what their function is, but I do get that. I'll probably look at creating a proper trivia questionnaire at some point, the next chapter in the book deals with the 'while' function so I could use that to loop people back to the question to try again if they get it wrong, say if I'm doing a multiple option question.I need to find a way of exporting to exe too so i'll be playing around over the next month trying to find a wayI'll let you know if I do.
As for the array, in python it would be called a dictionary. I'm pretty new to Python myself, working through codeacademy and a few books but it'd be something like this:
Code:weight = "user input" weight_dic = { 'Jupiter': 2.54, 'Saturn': 1.08, 'Uranus': 0.91, 'Neptune': 1.19, 'Pluto' : 0.06, 'the Moon': 0.17, 'Venus': 0.91, 'Mercury': 0.38, 'Mars': 0.38} for key, value in weight_dic.items(): print ("On " + key + ", you'd weigh " + str(weight * value) + "pounds.")
for Python 3
The for loop just cycles through the dictionary (weight_dic) line by line and prints out the set string + the 2 bits of info (the key and value).
Might be an even better way of doing it, not sure but I'm sure a more experienced programmer can help
Edit: I'd be much better at this if I could put as much effort into learn as I do into solving/looking in to things like thislol
I'll also keep my eyes peeled for an exe compiler, it certainly would be very helpful
![Big Grin :D :D](/styles/default/xenforo/vbSmilies/Normal/biggrin.gif)