Closed Thread
Results 1 to 3 of 3

Thread: why wont this work???

  1. #1
    opencircles is offline Newbie
    Join Date
    Oct 2009
    Posts
    8
    Rep Power
    0

    why wont this work???

    Code:
    input("please enter your age: ")
    
    a = input()
    
    if a < 18:
    print "you may not enter."
    else:
    print " you may enter."
    i have also tried instead of else. if a > 18 you may enter.

    wen the program is ran and i put anythin either over or under 18 is says you may not enter. wut is wrong here? ( i didnt write the code in python, i just wrote it here )
    Last edited by TkTech; 10-04-2009 at 09:48 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Excited is offline Newbie
    Join Date
    Oct 2009
    Posts
    27
    Rep Power
    0

    Re: why wont this work???

    whaat did my post just disapear? (not sure if this is an error or something)

    anyway here it is again:

    Code:
    a = input("please enter your age: ")
    
    if a > 18:
        print "you may enter"
    else:
        print "you may not enter"
    if you want to allow people who ARE 18 OR older:

    Code:
    a = input("please enter your age: ")
    
    if a >= 18:
        print "you may enter"
    else:
        print "you may not enter"
    short:

    Code:
    a = input("please enter your age: ")
    if a >= 18: print "you may enter"
    else: print "you may not enter"

    edit: did a mod just delete my post 0.0

  4. #3
    TkTech's Avatar
    TkTech is offline The Crazy One
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    1,412
    Blog Entries
    1
    Rep Power
    31

    Re: why wont this work???

    Yeah :/ Glanced away and thought I was still on a spam post, my bad :s

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Newbie :( Why wont my program work?
    By jim_jamaroo in forum C and C++
    Replies: 27
    Last Post: 06-03-2011, 01:51 PM
  2. $_POST wont work with ID attribute
    By ductiletoaster in forum PHP Development
    Replies: 1
    Last Post: 03-18-2010, 01:00 AM
  3. it wont work...nothing
    By the_code_charmer in forum Database & Database Programming
    Replies: 7
    Last Post: 12-10-2008, 05:03 PM
  4. Why wont it work
    By dvdtomkins in forum C and C++
    Replies: 7
    Last Post: 05-30-2008, 04:02 AM
  5. Got a domain, now it wont work but no errors?
    By phpforfun in forum PHP Development
    Replies: 24
    Last Post: 03-07-2008, 10:20 AM

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