Some suggestions??

Started by
11 comments, last by biggjoee5790 17 years ago
Hi everyone, Ive been working at learning Python for a few weeks now and Ive learned a whole lot. Now the concepts are beginning to get harder and I feel like I might be moving too fast. It seems like Im doing tons of reading but not very much doing. I feel like I should be applying what Im learning way more than I am. Im afraid that Im going to easily forget alot of the stuff that I have read if I dont use it. Ive learned many different aspects of Python, but Im still not comfortable using them. I understand how everything works, its just that, If someone was to tell me to create a program, any program, and it could be done with only the stuff Ive learned so far, Im pretty sure I would have a whole lot of trouble doing it. I hope I am being clear, My main point is that I dont feel like Im applying the concepts im learning and am in fear of wasting my time with my reading. Can anyone give some suggestions??
Advertisement
Everyone's different, but I definitely learn by *doing* and not by *reading*.

I'd take on a simple project to put all that knowledge into practice, then go back to the books as a reference when you forget things, or realise there's more you need to know.
Quote:Original post by Hodgman
Everyone's different, but I definitely learn by *doing* and not by *reading*.

I'd take on a simple project to put all that knowledge into practice, then go back to the books as a reference when you forget things, or realise there's more you need to know.



Yea, I definetely learn way more by doing than by reading. Thats why I feel like the concepts Ive learned are kinda slipping away from me a few days after I read about them. What kind of projects would you suggest taking on? I havent got into any object oriented concepts yet (classes, objects). I think creating some programs would really help me hold the info in my head better and just make me better period.
Even for those who learn better by reading, there's so much about practical programming which is never covered in books. You need to learn your compiler, the error messages it spits out, your debugger, debugging practices, source control, documentation, program design... tons of other stuff.

Experience is very valuable.

If you've only been going a few weeks, start super small. Print hello world to the screen. Print:

Hello 1 world.
Hello 2 worlds.
Hello 3 worlds.

Print the same thing to a file.

Read the file back in, sort descending and print to screen.


Just nice little incremental steps which add upon what you've already proven.
What exercises have you already done? If you let us know we can try to come up with something a bit different and should get an idea of which concepts you've learned so far.

- Jason Astle-Adams

How I can learn, and I mean really, ONLY learn, is by implementing the exact source code in a different way.

Let me clarify: When I was reading tutorials, if they told me how to print to the screen, I'd make a method that 'wrapped' it up, i.e., the method took a parameter that would be printed and the method would print it.

That is a bad example, but when I'd do things like this, it'd kinda force me to understand the concepts but I'd never be doing anything in huge steps. A big problem is broken into small ones, which are broken into smaller ones, etc, etc, and I'd tackle each very small problem this way.
You should spend some quality time with the Python Shell and just mess around. Putting those new skills to use is part of the learning process and depending on your background, python’s syntax can be a little bit of a mind bender at first.

I started really enjoying python once I was able to make basic functions with out having to look stuff up. So have fun with it. Btw, that built in ‘help (item)’ function that you can run from the shell is awesome.
Maybe If I show you guys some of the programs Ive made so far, you can see where Im at. Keep In mind that I didnt write these completely alone, I did refer to my book often, but I understand the Ideas in these programs. None of these programs are super complex, but for me they were quite tough :)

AN AREA FINDING PROGRAM FOR 3 COMMON SHAPES

def options_menu():    print "Options"    print " 'p' to print options"    print " 's' for area of a square"    print " 'r' for area of a rectangle"    print " 'c' for area of a cirle"    print " 'q' to quit"def area_of_sq(side):    return side**2def area_of_rect(side1,side2):    return side1 * side2def area_of_circ(radius):    return 3.14 * radius**2choice = "p"while choice != "q":    if choice == "s":        print "FINDING THE AREA OF A SQUARE"        side=input("Length of side: ")        print "Area is: ", area_of_sq(side)    elif choice == "r":        print "FINDING THE AREA OF A RECTANGLE"        side1=input("Length of 1st side: ")        side2=input("Length of 2nd side: ")        print "Area is: ", area_of_rect(side1,side2)    elif choice == "c":        print "FINDING THE AREA OF A CIRCLE"        radius=input("Radius: ")        print "Area is: ", area_of_circ(radius)    elif choice != "q":        options_menu()    choice=raw_input("Choice: ")


A TIMES TABLE UP TO 10

def printMultiples(n):    i = 1    while i <= 10:        print n*i, '\t',        i = i + 1    printi = 1while i <= 10:    printMultiples(i)    i = i + 1



A Login Program (description in the code)

# This program asks a user for a personalized username and password to save# into the system. Then it allows them to login by entering the information.# Once they are logged in, they can choose to lock out others with the "Lock"# command. Once the program is locked, the username and password must be# re-entered to unlock it.print "Enter Desired Username and Password"User=raw_input("Username: ")Pass=raw_input("Password: ")print "Username and Password Saved!"loop="loop"while loop=="loop":    print "Enter Username And Password To Log In"    login=""    while login != User:        login=raw_input("Username: ")    login2=""    while login2 != Pass:        login2=raw_input("Password: ")    print "Welcome!"        LOCK = ""    while LOCK != "Lock":        LOCK = raw_input("Type 'Lock' to lock system: ")    print "System Locked"



I also made a guess the number program but I dont want to make this post too long :) Hopefully you can now see what I know so far. Since I made these programs I have learned some new stuff. I learned about Lists, Tuples, Dictionaries, and File IO. I wouldnt be able to use those concepts too well at all yet, but I have an idea of how they work. Any suggestions for me?
Quit goofing around on gamedev and go practice stuff 8)! It doesn't matter if you are getting help from the book, as long as you are writing code and constantly pushing yourself.
Sure is a big 'ol world.
Practice, practice, practice! It doesn't particularly matter all that much what you're making as long as you're making something. A few ideas:

- Can you add another option to your area program for finding the area of a triangle? You should be able to find the appropriate formula with a bit of online searching if you don't already know it.

- Can you make another version of your area program, but calculate the perimeter of the shapes rather than the area?

- Can you combine the two above programs into a larger one which can calculate the area or perimeter or each of those shapes?

- Can you make the opposite of the 'guess my number' program, where the computer has to guess your number and you tell it higher or lower till it gets it correct?

- Can you modify your 'login' program to store the user information in a file?


As a beginner it's perfectly fine that you're referring to your book often. Advanced programmers often still do this, they're just typically looking up more complicated things. As you use the simple things more and more you'll start to remember them better and won't have to look them up as much, but you'll still need to check up on small details or more advanced features from time to time.

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement