Phoebe2006-08-08 01:04:12
Can somebody please point me in the direction of a python tutorial?
Unknown2006-08-08 01:15:50
The "Non-Programmers Tutorial for Python" might be a good place to start.
http://honors.montana.edu/~jjc/easytut/easytut/
If you're more of a programmer type, the lengthy tutorial from the author will cover all the bases.
http://docs.python.org/tut/
For a long list of Python tutorials, sorted into categories for you, check out this one:
http://www.awaretek.com/tutorials.html
(Hint: Google is a good place to find just about anything and it only takes about three seconds on a decent connection.)
http://honors.montana.edu/~jjc/easytut/easytut/
If you're more of a programmer type, the lengthy tutorial from the author will cover all the bases.
http://docs.python.org/tut/
For a long list of Python tutorials, sorted into categories for you, check out this one:
http://www.awaretek.com/tutorials.html
(Hint: Google is a good place to find just about anything and it only takes about three seconds on a decent connection.)
Unknown2006-08-08 01:54:43
Do you know where I can find one of those "non-programmer" guides for lua?
Phoebe2006-08-08 02:02:33
I have heard of google like who hasent but theres only specific guides and I want something that will teach me everything I will need to know
Unknown2006-08-08 03:10:48
Your hopeless phoebe, he gave you everything you asked for...
Phoebe2006-08-08 04:27:29
its beautiful though but I cant find out whats wrong with this
string1=raw_input("most retarded person in the house is")
string2=raw_input("if you said John you were right")
interger1=input("just to prove it whats 8x7?)
interger2=input("CORRECT! now whats 2x3?)
print 'string1=', string1
print 'string1 is a',type(str)
print 'string2=', string2
print 'string2 is a',type(str)
print 'interger1=', interger1
print 'interger1 is a',type(num)
print 'string1 * interger1 is a',str*num
print 'string2 * interger2 is a',str*num
Ohh yea John is my brother who is over at my house soo no offence to anybody hehe
string1=raw_input("most retarded person in the house is")
string2=raw_input("if you said John you were right")
interger1=input("just to prove it whats 8x7?)
interger2=input("CORRECT! now whats 2x3?)
print 'string1=', string1
print 'string1 is a',type(str)
print 'string2=', string2
print 'string2 is a',type(str)
print 'interger1=', interger1
print 'interger1 is a',type(num)
print 'string1 * interger1 is a',str*num
print 'string2 * interger2 is a',str*num
Ohh yea John is my brother who is over at my house soo no offence to anybody hehe
Sylphas2006-08-08 04:32:21
Integer. NOT interger. ONE r, not two.
It throws an error if you give null input; you'll want to catch that.
Only thing I can see wrong with it is that you're missing a few ".
It throws an error if you give null input; you'll want to catch that.
Only thing I can see wrong with it is that you're missing a few ".
Phoebe2006-08-08 04:37:27
ok I got it heh just dident need to put print infront of all the data ie everything exept for the input and raw_input and the last 2 lines for people who are trying to learn
Ixion2006-08-08 04:46:59
I certainly don't miss my days working with python in a physics course... bo-ring.
Phoebe2006-08-08 07:26:49
I'm actuley quite likeing it. Its quite amazing
Yrael2006-08-08 08:44:17
QUOTE(Zarquan @ Aug 8 2006, 11:15 AM) 316489
(Hint: Google is a good place to find just about anything and it only takes about three seconds on a decent connection.)
You're a royal bastard sometimes, you know that?
Funny, tho.
Phoebe2006-08-08 14:58:29
# Waits until a password has been entered. Use control-C to break out with out
# the password
#Note that this must not be the password so that the
# while loop runs at least once.
password = "foobar"
count=0
#note that != means not equal
while password <> "unicorn":
password = raw_input or input("Password:")
if password!="password":
count==count+1
while count == 3:
print "maybe you should have bought the program"
print "Welcome in"
whats wrong with it?
# the password
#Note that this must not be the password so that the
# while loop runs at least once.
password = "foobar"
count=0
#note that != means not equal
while password <> "unicorn":
password = raw_input or input("Password:")
if password!="password":
count==count+1
while count == 3:
print "maybe you should have bought the program"
print "Welcome in"
whats wrong with it?
Unknown2006-08-08 16:19:57
Blocks require indentation. It's not
while/if/for:
it's
while/if/for:
   Â
The amount of spaces you choose to indent is up to you.
Also, what's
password = raw_input or input("Password:")
First of all, raw_input needs an argument for it to get the user input. Simply putting raw_input won't do it, you need something like raw_input(""), I think.
Also, the "raw_input or input("Password:")" part is very confusing. You can replace it with something simpler, like
password = raw_input("Password:")
As for your code, there's logic problems with it as well.
When you have
while password <> "unicorn":
  password = raw_input or input("Password:")
what you're doing is making the user enter the password until he types "unicorn" which will make the while loop stop.
Once the loop stops, however, you do a check to see
if password != "password"
However, the only way for the interpreter to stop the loop and move to the if-statement is for password to have the value of "unicorn", and if it has the value of "unicorn", it's definitely not going to have the value of "password". Therefore, the if-statement will always execute, which means that count will be increased by one. But since the if-statement is executed only once, the while loops never executes (because count != 3, count == 1), and the program finishes by saying "Welcome in".
If you want the password program to work, here's a debugged version:
password = "Unicorn"
count = 0
passwordCorrect = False
userEnteredPassword = ""
while count < 3 and passwordCorrect == False:
    userEnteredPassword = raw_input("Please enter your password: ")
    if userEnteredPassword == password:
        print "Welcome in."
        passwordCorrect = True #This will make the while loop quit
    else:
        count += 1 #Increase the count by one
#End of while loop
if count == 3 and userEnteredPassword != password:
    #The user surpassed the incorrect password limit
    print "Neener neener you should have bought the program!"
CODE
while/if/for
it's
CODE
while/if/for
   Â
The amount of spaces you choose to indent is up to you.
Also, what's
CODE
password = raw_input or input("Password:")
First of all, raw_input needs an argument for it to get the user input. Simply putting raw_input won't do it, you need something like raw_input(""), I think.
Also, the "raw_input or input("Password:")" part is very confusing. You can replace it with something simpler, like
CODE
password = raw_input("Password:")
As for your code, there's logic problems with it as well.
When you have
CODE
while password <> "unicorn":
  password = raw_input or input("Password:")
what you're doing is making the user enter the password until he types "unicorn" which will make the while loop stop.
Once the loop stops, however, you do a check to see
CODE
if password != "password"
However, the only way for the interpreter to stop the loop and move to the if-statement is for password to have the value of "unicorn", and if it has the value of "unicorn", it's definitely not going to have the value of "password". Therefore, the if-statement will always execute, which means that count will be increased by one. But since the if-statement is executed only once, the while loops never executes (because count != 3, count == 1), and the program finishes by saying "Welcome in".
If you want the password program to work, here's a debugged version:
CODE
password = "Unicorn"
count = 0
passwordCorrect = False
userEnteredPassword = ""
while count < 3 and passwordCorrect == False:
    userEnteredPassword = raw_input("Please enter your password: ")
    if userEnteredPassword == password:
        print "Welcome in."
        passwordCorrect = True #This will make the while loop quit
    else:
        count += 1 #Increase the count by one
#End of while loop
if count == 3 and userEnteredPassword != password:
    #The user surpassed the incorrect password limit
    print "Neener neener you should have bought the program!"
Phoebe2006-08-08 18:12:03
the raw_input and input thing is because input is numbers raw_input is letters doing an or will let either go in and yes its gramaticly correct i dident catch the loop hehe
Phoebe2006-08-08 18:25:24
CODE
Traceback (most recent call last):
  File "C:/Program Files/python/average.py", line 8, in -toplevel-
    passwordcorect=false
NameError: name 'false' is not defined
  File "C:/Program Files/python/average.py", line 8, in -toplevel-
    passwordcorect=false
NameError: name 'false' is not defined
Unknown2006-08-08 18:30:19
It's False, not "false." Capital F. You also misspelled "passwordCorrect," by the way. Two "r"s in "correct."
Phoebe2006-08-08 18:36:39
it looped! please enter your password:jh
please enter your password:dfag
please enter your password:djasg
please enter your password:dag
please enter your password:fhajgfa
please enter your password:fafguea
please enter your password:feuagfad
please enter your password:dfag
please enter your password:djasg
please enter your password:dag
please enter your password:fhajgfa
please enter your password:fafguea
please enter your password:feuagfad
Unknown2006-08-09 01:20:31
Are you sure you have the counter settings correct? A counter < 3 check has to be done in the while conditional or somewhere in the loop. Or it might be something small that's causing the error, such as a misspelled word or a "=" instead of a "==" - those little things are annoying, the interpeter doesn't catch a lot of things as syntax errors and so they go unnoticed. If you want, you can post your code up; it's probably easier to debug it that way.
By the way, it's , not .
By the way, it's , not .