Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

This is an exercise on one of the readings. def password(): n=0 a=str(raw_input("Password:")) b="bob123" if a==b: print "You have successfully logged in" n=0 exit() else: n+1 print "Sorry your password was wrong" if n==3: print "You have been denied access" exit() password() all i wanna know is how do i get it to not print the blank space(runtime error) before the raw_input/"password:"

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SEE EXPERT ANSWER

To see the expert answer you'll need to create a free account at Brainly

I figured it out my ordering was wrong if someone knows why the order changed this please explain. I know it fixed it but I still don't understand why? def password(): n=0 while n<3: a=str(raw_input("Password:")) b="bob123" if a==b: print "You have successfully logged in" n=0 exit() else: n=n+1 print "Sorry your password was wrong" if n==3: print "You have been denied access" exit() password()
I'm not sure what you're asking here. There's nothing in the first example that would cause it to print a 'blank space'. The only difference is that one uses a while loop to only allow 3 errrors and the first example does not.
What the heck i ran it severely times yesterday and it kept printing a blank input space before it said 'password:' but now when i try it it's working fine. Thanks anyway.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question