Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Python (http://www.programmingforums.org/forum43.html)
-   -   I'm a Beginner (http://www.programmingforums.org/showthread.php?t=14676)

Chuckiferd Dec 3rd, 2007 4:49 PM

I'm a Beginner
 
Hello all I am new here. I have taken a course on Python so I guess I could say I know Python code. Unfortunatly the online course I took never put the different parts together. So while i can write a tupple and a list, I can't write a multi-step program with it. I was wondering if someone could show me how to apply the little knowledge I got from that course. I started programing so I could begin writing games so maybe someone could find the code to a simple game like Pong and walk me through it. Thank you for taking your time to help a beginner programer out.

Sane Dec 3rd, 2007 4:56 PM

Re: I'm a Beginner
 
Sure thing. But no one here can conjure information from nothing.

Do you have any particular questions? Code you can not get working?

You reference being able to work with tuples and lists, but can't write a multi-step program? What problem are you running into? A program is simply a sequence of lines, or steps, that are sequencially interpreted. So if you want to combine a program that works with tuples, with a program that works with lists, it's as simple as putting the two together.

MyListProgram.py
:

# This is my list
fruits = ['Apple', 'Banana', 'Pear']

# Go through each fruit in the list
for fruit in fruits:

    # Output the fruit
    print fruit


MyTupleProgram.py
:

# This is my tuple
prices = ('1$ Per Bag', '2$ Per Basket')

# Go through each price in the tuple
for price in prices:
   
    # Output the price
    print price


CombinedProgram.py
:

# This is my list
fruits = ['Apple', 'Banana', 'Pear']

# This is my tuple
prices = ('1$ Per Bag', '2$ Per Basket')

# Go through each fruit in the list
for fruit in fruits:

    # Go through each price in the tuple
    for price in prices:

        # Output the fruit and the price
        print fruit, price


Chuckiferd Dec 3rd, 2007 7:16 PM

Re: I'm a Beginner
 
I did learn how to cross the lists and tuples but I can't exactly do anything with those lists and tupples. What I meant was I couldn't find how to mix everything together to make a large program.

Your question if I am having problem with code is no, since I can't write code

titaniumdecoy Dec 3rd, 2007 7:28 PM

Re: I'm a Beginner
 
You'll have to be much more specific if you want help.

Sane Dec 3rd, 2007 9:59 PM

Re: I'm a Beginner
 
Quote:

Originally Posted by Chuckiferd (Post 138006)
Your question if I am having problem with code is no, since I can't write code

Well there's your problem. :?:

MiKuS Dec 3rd, 2007 10:08 PM

Re: I'm a Beginner
 
reading and messing around with code is not generally considered knowing the language.

if you really understood how to code you wouldn't be asking these sorts of questions.
you should consider flicking through: http://www.catb.org/~esr/faqs/smart-questions.html

on the other hand you need to think of a real world program and code it - something simple a calculator, time zone calculator or even a numbers guessing game it's up to your imagination to code something.

Chuckiferd Dec 4th, 2007 8:29 PM

Re: I'm a Beginner
 
Your right I guess that was a bad question. Here is a better question, can someone give me a link to a Good Python tutorial site? Possibaly the one you learned from. I have tried google and all it gave me was a lot of poorly done tutorials on Python that is meant for the expirienced programer anyways.

Sane Dec 4th, 2007 9:19 PM

Re: I'm a Beginner
 
Many people here were born and raised by Python's How To Think Like A Computer Scientist. It's very thorough, yet simple and succinct.

titaniumdecoy Dec 4th, 2007 9:29 PM

Re: I'm a Beginner
 
I learned Python via Mark Pilgrim's book Dive Into Python. (You can read the book for free online in a variety of formats.) I highly recommend it.

Chuckiferd Dec 5th, 2007 3:16 PM

Re: I'm a Beginner
 
(Chuckiferd's jaw drops, he then takes out reading glasses)

Ah-em.. this might take a wiee bit.


All times are GMT -5. The time now is 12:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC