|
|
Or, use your gamerDNA username: (more...)
| ||||||
| |
![]() |
| | LinkBack | Thread Tools | Rate Thread | Display Modes |
| | #1 (permalink) |
| Registered User Join Date: Nov 2003 Location: Dutchess co
Posts: 94
| Python 3.0 I'm trying to teach myself Python 3.0 and I have very limited programing skills. My preferred form of learning is kinetic (learning by doing). I am reading the design documentation and without examples to program (that are meaningful) it's hard for me to grasp what is going on. There is only one book out right now for 3.0. I was wondering if any of you know of a website or resource I can use to get assignments or challenges to program at a beginner skill level?
__________________ Etruscus - EQ2 - AB - Mistwalkers |
| | |
| | #2 (permalink) |
| Registered User Join Date: Aug 2002 Location: Paris
Posts: 375
+1 Internets | Python 2.x is not that different from Python 3.0. You might want to start learning with it because there are A LOT more resources on the net about Python 2.x than 3.0. It's not compatible but I'm sure beginners program aren't complicated enough that it would be a problem. Anyway, there was some list somewhere of the differences in 3.0, I'm sure you can find it pretty easily and then convert whatever program you wrote during your learning if you really want to keep them. |
| | |
| | #4 (permalink) |
| Registered User Join Date: Sep 2002
Posts: 57
| python.org has the tutorial for 3.0 complete already. Python 2.x (2.6 currently) and 3.0 are different enough that a not-insignificant portion of the old-guard python folk are kinda ticked at the direction the language has gone (personally, the new string formatting stuff drives me batty). But 3.0 was in part designed with people new to the language in mind and to that end, they've done a pretty good job with it as far as I've seen. 2.6 is going to have a lot of resources and it's a good place to start, but try the 3.0 tutorial first unless you're going to have to support 2.6 code immediately. If you learn the 2.x branch first, there are a few common things you'll have to unlearn that, in a pinch, you can import into 2.6 from 3.0 with the 'from future' directive if absolutely necessary. |
| | |
| | #5 (permalink) | |
| Registered User Join Date: Aug 2002 Location: Paris
Posts: 375
+1 Internets | Quote:
![]() I also love being able to type "import antigravity" and get a result... <3 python | |
| | |
| | #7 (permalink) | |
| Registered User Join Date: Nov 2003 Location: Dutchess co
Posts: 94
| Quote:
The gui would need to allow for entry of up to 25 years, where an event has a certain likelihood of occurring every year, summing to 1000. This distribution looks more or less random, but it has a slight kurtosis. The distribution is empirical as well. Excel just can't handle the level of computation that I need. I'm not on any kind of deadline, since they don't know I'm working on it. It occurred to me a couple weeks ago that calculating this asset by using the IRR iterative algorithm was leading to errors, since it always assumes anything reinvested would be reinvested at that specific IRR, and of course your discount rate changes as the market changes, so your output will always be erroneous. For this project, learning 2.5 or 2.6 would be fine. But, I'm a computer gaming nerd at heart and I want to learn 3.0 to get a better understanding of what it means to actually run a large project like an MMO. I don't think there is a single computer game player in the market that hasn't said "I can do this better" and if they haven't, they are a console player Since 3.0 is the future, i think it makes sense to learn 3.0, even though very little is supporting right now.
__________________ Etruscus - EQ2 - AB - Mistwalkers | |
| | |
| | #8 (permalink) |
| Fires of Heaven Officer Join Date: Jan 2002 Location: Melbourne, Australia
Posts: 3,364
+25 Internets | maybe try delphi. its a totally different language but its got tight db integration and very easy to construct a gui. I used it to write a program that recalculates a person's mortgage to find out any errors about 12 years ago so it should be able to do what you're after. |
| | |
| | #9 (permalink) | |
| Registered User Join Date: Jan 2002
Posts: 1,918
| Quote:
Last edited by prescient63; 01-24-2009 at 06:11 PM.. | |
| | |
| | #12 (permalink) |
| The Next Orange Join Date: Sep 2006
Posts: 1,321
+11 Internets | I'm running through the Python intro for fun as well. My programming experience is limited to HTML, Coldfusion, PHP, and SQL, so this question might be stupid for people who have worked with C. Question - the following lines are from one of the first pages of the tutorial. Code: >>> word = 'Help' + 'A' >>> word 'HelpA' >>> '<' + word*5 + '>' ' Code: >>> word*5 'HelpAHelpAHelpAHelpAHelpA' >>> ' An Informal Introduction to Python — Python v3.1a0 documentation That's the page, it's like halfway down, section on concatenates. Don't understand why '<' + word*5 + '>' works but '<'word*5'>' does not. Last edited by MrGraham; 02-03-2009 at 01:19 PM.. |
| | |
| | #13 (permalink) |
| -internets from anon retards mean jack Join Date: Nov 2003 Location: Overthere next to that place
Posts: 2,720
| iirc '<'word*5'>' and '<' word*5 '>' are two separate things also. python reads spaces where as other programing languages do not. That's iirc don't forget. Been a while since I have tried to learn it.
__________________ ![]() Give me more -internets you little bishes! |
| | |
| | #14 (permalink) |
| is a little tea pot. Join Date: Jan 2004 Location: Carlsbad CA
Posts: 6,465
+75 Internets | I've been trying to learn Python 3.0 on my own and I'm having problems getting user input to work. I'm not sure what the correct syntax is... Code: print ("There's a door to the north and road to the east.")
if input == north:
print("You push your way through the door")
else:
print ("Which way do you want to go?")
if input == east:
print("Something is preventing you from going that way")
else:
print ("Which way do you want to go?") Code: print ("There's a house to the North and a cave to the East? ")
usercmd = input ("Which direction will you go?" )
if usercmd == ("North") or ("N"):
print ("You move North towards the house.")
elif usercmd == ("East") or ("E"):
print ("You attempt to enter the cave but find it is blocked.") Last edited by Zarcath; 06-03-2009 at 03:45 PM.. |
| | |
| | #15 (permalink) | |
| Registered User Join Date: Jan 2003
Posts: 978
| Quote:
The +s concat those strings. Without that it has no idea what you're trying to do. It'd be like typing 5 3*5 5 into a calculator. It doesn't know that you're trying to add them together. For the user input problem, you can print out the usercmd to see what it receives from the input(). That or run it through a debugger to find out why it's not working. Maybe remove the ORs to see if it works without. It's been a long time since I used Python 2 even so I'm not 100% on the syntax at all. | |
| | |
![]() |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
| |