How can i fix this?

  • Thread starter БориÑлав БориÑлавов
  • Start date
Ð

БориÑлав БориÑлавов

while 1:
name=raw_input("What is your name? ")
if name == "bobi": print "Hello Master!" and break
else: print "error"




I want if my conditions are met to do a couple of things and i cant do that
 
P

Peter Otten

БориÑлав БориÑлавов said:
while 1:
name=raw_input("What is your name? ")
if name == "bobi": print "Hello Master!" and break
else: print "error"
I want if my conditions are met to do a couple of things and i cant do
that
while 1:
name=raw_input("What is your name? ")
if name == "bobi":
print "Hello Master!"
break
 
Ð

БориÑлав БориÑлавов

23 юни 2013, неделÑ, 00:46:37 UTC+3, Peter Otten напиÑа:
БориÑлав БориÑлавов wrote:









print "Hello Master!"

break

this doesent help me at all
 
M

Mark Lawrence

while 1:
name=raw_input("What is your name? ")
if name == "bobi": print "Hello Master!" and break
else: print "error"

I want if my conditions are met to do a couple of things and i cant do that

You most certainly can :)

while 1:
name=raw_input("What is your name? ")
if name == "bobi":
print "Hello Master!"
print "Why do some people insist on cramming all of their code
onto one line?"
break
else:
print "error"

--
"Steve is going for the pink ball - and for those of you who are
watching in black and white, the pink is next to the green." Snooker
commentator 'Whispering' Ted Lowe.

Mark Lawrence
 
I

Ian Kelly

this doesent help me at all

It shows you how to include multiple statements in the body of the if
block. If you're having trouble getting it to work, then please copy
and paste the exact code that you're running for us along with the
error message that you get. But we can't help you solve your problem
if we don't know what it is.
 
J

John Gordon

this doesent help me at all

Then you'll have to explain why, exactly, it doesn't help. Simply saying
"this doesn't help me" is very unhelpful to *us*.

Does it produce a syntax error?
Does it run, but produce the wrong output?
Some other reason?
 
Ð

БориÑлав БориÑлавов

okay i got it thank you all :))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,135
Messages
2,570,783
Members
47,340
Latest member
orhankaya

Latest Threads

Top