Closed Thread
Results 1 to 6 of 6

Thread: "ifs" and "elses" etc in python...help?!

  1. #1
    amateur is offline Newbie
    Join Date
    Jul 2009
    Posts
    8
    Rep Power
    0

    "ifs" and "elses" etc in python...help?!

    ...
    Last edited by amateur; 07-08-2009 at 11:47 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    amateur is offline Newbie
    Join Date
    Jul 2009
    Posts
    8
    Rep Power
    0

    Re: "ifs" and "elses" etc in python...help?!

    ...
    Last edited by amateur; 07-08-2009 at 11:45 AM.

  4. #3
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: "ifs" and "elses" etc in python...help?!

    You haven't listed the full code, the exact error messages, or anything else. It's hard to help without that kind of information.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    ShadenSmith's Avatar
    ShadenSmith is offline Newbie
    Join Date
    May 2009
    Location
    Kentucky - USA
    Posts
    19
    Rep Power
    10

    Re: "ifs" and "elses" etc in python...help?!

    WingedPanther is correct, please post the source code and error message in order for us to be able to help. Please use the ["code"] tags (without the "").

  6. #5
    CallBackGuy is offline Newbie
    Join Date
    Mar 2009
    Posts
    29
    Rep Power
    0

    Re: "ifs" and "elses" etc in python...help?!

    Quote Originally Posted by amateur View Post
    ok...i've defined a, b and c.

    i want to make python give me the values for when a= b/c.

    i indented a bit, and then wrote "if a=b/c:"

    after entering taht line, i got an error type message on my screen.

    so can you tell me exactly what to type after defining a, b and c? was getting ready to try and "else, if" type thing, where i'd say, if a=b/c then print a, b and c. else print nothing.............HHHEEEELLLLPPP!!!!
    You simply want to check if a is equivalent to b and c?
    Code:
    a, b, c = 1, 2, 2
    
    while 1:
    	if a == b and c:
    	     print "a equals %s which is the same as b(%s) and c(%s)"%(a, b, c)
    	     break
    	else:
    	     print "a equals %s which is not the same as b(%s) and c(%s)"%(a, b, c)
    	a = 2

  7. #6
    Butters is offline Newbie
    Join Date
    Jul 2009
    Location
    York, UK
    Posts
    1
    Rep Power
    0

    Re: "ifs" and "elses" etc in python...help?!

    You want the line "if a == b/c:"
    a=b/c is an assignment.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 09-20-2011, 05:11 AM
  2. MASM How To Use "Open" And "Save As" (Win32 API) ?
    By RhetoricalRuvim in forum Assembly
    Replies: 12
    Last Post: 08-13-2011, 04:10 PM
  3. "\r\n" are for some reason turned into "\r\n\r\n"; what's wrong?
    By RhetoricalRuvim in forum Ruby Programming
    Replies: 1
    Last Post: 08-06-2011, 05:55 PM
  4. Alex G. CSS "Sexy Buttons" - what about "submit on 'ENTER'" ?
    By shackrock in forum JavaScript and CSS
    Replies: 7
    Last Post: 12-05-2010, 04:57 PM
  5. Replies: 2
    Last Post: 11-01-2010, 11:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts