FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


To learn a programming language: Python





lovescience
I am new to programming language on computer. I would like to explore this field and to learn about a programming language.

I did a bit research on which language I would like to learn. It came up to be Python. It is an interpreted programming language, which means it can be understood by both Windows and Mac computer.
badai
if you learn it from zero, then also post a tutorial here every time you learn. i'd like to know python too.
davidv
I've used Python for a little over 3 months now and it's definitely my favourite language to use. There's tonnes of documentation and online tutorials that help guide your way to proper pythonic programming Smile It's a very fun language to play with. It's especially exciting when you hit the functional programming side of it.
lovescience
First is to download Python interpreter, here is a link to download
http://wiki.python.org/moin/BeginnersGuide/Download

Python 3 is the latest version. But Python 2 has more support.
So I decide to use Python 2 version.
lovescience
After install Python, go to start menu, you can find Python, and go to open IDLE.

These are two ways to create .py file.

First one, you can use note pad, and save the file to .py. Open it in IDLE, under File>Open. Then, go to Run> Run Module.

Or you can create one in IDLE.
lovescience
To practice, I put these in .py file.

print "text";

print 1+1;

print 1-1;

print 2*2;

print 2**3;

print 6/2;

print 45.0/7.0;
__________________________
After run module, I got these:

text
2
0
4
8
3
6.42857142857
Radar
If you're not familiar with programming, as a simple, high-level language, Python is probably a great place to start, yeah. Go for it.
lovescience
Ok. I created another .py file.

And typed in,
sweet="chocolate ice cream"
sour="lemon pie"
drink="ice tea"
dessert=sweet+"/"+sour+"/"+drink
print dessert

________________________
After run module, here they are,

chocolate ice cream/lemon pie/ice tea


Smile
Hello_World
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/

try that if you are okay at maths, or

http://learnpythonthehardway.org/book/

is another popular option...

or maybe,

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/

(not sure, haven't looked into that much.)
jcreus
lovescience wrote:
Ok. I created another .py file.

And typed in,
sweet="chocolate ice cream"
sour="lemon pie"
drink="ice tea"
dessert=sweet+"/"+sour+"/"+drink
print dessert

________________________
After run module, here they are,

chocolate ice cream/lemon pie/ice tea


Smile

Something funny you could do is work with the random module. i.e.
Code:

import random

sweet = ["chocolate ice cream","another kind of ice cream"]
sour = ["lemon pie", "another sour"]
drink = ["ice tea","water","wine"]
dessert = random.choice(sweet)+"/"+random.choice(sour)+"/"+random.choice(drink)
print dessert

My English isn't very good so I don't know many types of food Sad.
pirate
If you want to learn python i would recommend going to http://www.thenewboston.com Very good tutorial website.
davidv
pirate wrote:
If you want to learn python i would recommend going to http://www.thenewboston.com Very good tutorial website.


I'm going to have to disagree.

Despite his high video ratings and the large influx of positive comments. I find his tutorials agonizing and incredibly trivial to sit through. If you're new to programming, you're much better off going here http://wiki.python.org/moin/BeginnersGuide but if you've had past experience... as they say, every subsequent language you learn is 25% easier than its predecessor i.e. go look elsewhere for help.

I'm going to have to reiterate, thenewboston or bucky as he likes to call himself has very trivial tutorials. I mean c'mon 2 videos 12mins + to explain what slicing is? I don't even think he mentioned negative indices or maybe he did but I fell asleep during his long introduction. But that's just my opinion. I'm not a fan of him and I don't like his tutorials because they're not very good.
lovescience
Thanks!

I will go try the random module and see these tutorials!
lovescience
jcreus wrote:

Code:

import random

sweet = ["chocolate ice cream","another kind of ice cream"]
sour = ["lemon pie", "another sour"]
drink = ["ice tea","water","wine"]
dessert = random.choice(sweet)+"/"+random.choice(sour)+"/"+random.choice(drink)
print dessert



It is a fun thing to do!

Add
import random
and
[,]
and use
random.choice()

Now
It makes a choice!
chicanh
basic and standard : http://docs.python.org/index.html
I thinks it useful for everyone,
jurl
try this:
Code:
print "write less, do more" * 5


or this:
Code:
2 ** 100


or this
and keep your browser open...its 'easter egg' Smile
Code:
import antigravity
shazhouke
lovescience wrote:
I am new to programming language on computer. I would like to explore this field and to learn about a programming language.

I did a bit research on which language I would like to learn. It came up to be Python. It is an interpreted programming language, which means it can be understood by both Windows and Mac computer.

A lot of languages works cross platforms. All kinds of scripting languages (python, perl, ruby, etc..), and the Java even C# (with mono framework on Linux or Mac). However, I suggest python. It's easy to learn and requires less computer science background.
c'tair
Python is a great choice.

First of all, it can be used to build web applications and pretty damn good websites.

Second of all, it's really simple but still powerful - it's great for prototyping algorithms and programs before coding them in a language that's gonna need more time. This also means that if you get an idea - you can at least make a demo of it really fast to see if it's worth the effort.

Seriously, learning python was one of the best decisions I ever made.
masterekat
At www.coursera.org, Rice University will be offering an online course called An Introduction to Interactive Programming in Python starting Oct. 15, 2012 for anyone who is interested. It's free to take and lasts eight weeks. I am currently taking another Python course on Coursera through University of Toronto and I'm very satisfied with it so far.

Coursera also offers courses on a wide variety of topics, all free to take and some instructors will even send you a certificate if you complete the work with at least a certain percentage.
darthrevan
Nice info on the free courses, I will look it up when I get home. Generally it is hard for me to remember things, so remembering programming code will be tough. Though programming my own app would be awesome.
Related topics
Beginning Programming... Help!
how did you learn about html, php or other languages???
best 3d program
Visual Basic 6
Python
The Game creation topic! - Share experience - Find resources
Best Programming Language to Use
The Best Web Programming Language?
About pascal programming language
Survey on Programming Language
Can c++ still be kald a programming language?
Day 02 Preferred programming language?
New to programming, which language do I choose?
Good Cross Platform Programming Language
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.