-2

I have a program that gets a string from a user (raw_input) and sees if the length of it is greater than 8, for example. If it isn't it starts again, otherwise the program ends.

I'm using Python 2.7.8 and this is the code I'm using so far, but it doesn't work...

password = raw_input("Type in a password: ")

if password.len() > 8 :
    print "Successful!"
else :
    goto(1)

Can anyone solve this problem?

JDS404
  • 65
  • 1
  • 1
  • 9

1 Answers1

2

You need to learn the basics. You should start with a Python tutorial.

Here's the official Python tutorial from python.org; this section introduces the while statement, which you can use to make a loop.

https://docs.python.org/2/tutorial/introduction.html#first-steps-towards-programming

steveha
  • 74,789
  • 21
  • 92
  • 117