PDA

View Full Version : Python on windows 7



Danimal Sheahon
04-16-2011, 01:25 AM
im trying to learn how to read and write in computer language and all that stuff and i just downloaded and installed Python 3.2 for my computer and im on a tutorial website and its confusing as fuck. i keep getting syntaxerror messages and shit
ex:
>>> the_world_is_flat= 1
>>> if the_world_is_flat:
print "be careful not to fall off!"

Syntaxerror: invalid syntax

can someone help me plsssss :(

acolyte_to_jippity
04-16-2011, 02:10 AM
try a space after the_world_is_flat

and is the_world_is_flat a boolean, or an int?

Danimal Sheahon
04-16-2011, 02:32 AM
to be honest, idk.
idk what a boolean or an int is...
i just read that python is the easiest thing to start with when learning how to code...

BladeTwinSwords
04-16-2011, 07:54 AM
The easiest code language is most certainly BASIC

StarsMine
04-16-2011, 09:18 AM
to be honest, idk.
idk what a boolean or an int is...
i just read that python is the easiest thing to start with when learning how to code...

Boolean is a single bit var, being 1 or 0, often used for true/false

int, well that depends on the code for the spicifics, but its usually I believe 8 bits, and well int is short for intiger

Blashyrkh
04-16-2011, 10:52 AM
The easiest code language is most certainly BASIC

This.
There is a minor syntax error:
>>> if the_world_is_flat:
should be
>>> if (the_world_is_flat == 1):

But I don't think this should have been coded in the console. The console is mainly used for calling the functions you make in the upper box [can't remember its name now >_>]
Make something in the upper box that says

def flatWorld()
isFlat = 1
if (isFlat == 1):
print "be careful not to fall off!"

Then in the console, type this:
>>> flatWorld()

Danimal Sheahon
04-16-2011, 05:27 PM
idk what upper box you are talking about.

i have two comand consoles. one is white and one is black and what white one give me colored letters.
both are in interactive mode seeing as how i get the ">>>" prompting me for my next set of commands.

Blashyrkh
04-16-2011, 05:56 PM
idk what upper box you are talking about.

i have two comand consoles. one is white and one is black and what white one give me colored letters.
both are in interactive mode seeing as how i get the ">>>" prompting me for my next set of commands.
def flatWorld()
isFlat = 1
if (isFlat == 1):
print "be careful not to fall off!"
-Should be in the white box

>>> flatWorld()
-Goes in the black box afterward.

wack0
04-16-2011, 07:36 PM
This will help you: http://codingbat.com/python

it's amazing, practice coding right in the browser

Danimal Sheahon
04-16-2011, 09:00 PM
ok. so i have the black command prompt but i dont have the white screen. and when i did they were both giving me ">>>"

i cant figure out where the white one went or how to get it so that ">>>" doesnt show up so i cant type situations in.