|
| Author | Message |
|---|
ǤɌəƉ CDT Coder (In-Training)


Posts: 16 Join date: 2009-05-11 Age: 15
 | Subject: My First Program Tue May 19, 2009 9:01 am | |
|
Last edited by ǤɌəƉ on Tue May 19, 2009 12:39 pm; edited 1 time in total |
|
 | |
xerion CDT Coder


Posts: 32 Join date: 2009-05-13 Age: 15 Location: Brizzie
 | Subject: Re: My First Program Tue May 19, 2009 9:15 am | |
| Yea its strange but it works just a piece of advice, at the end of any if/elif statements make sure you put a else to catch all the things that are not in the list For Example: | Code: | loop = 1 while loop == 1: print 'type what group you belong to (TC, Jock, Programmers, Nerds or None of the above)'
group = 'TC'and'Jock'and'None of the above'and'Programmers'and'Nerd'
group = raw_input("Enter group type: ")
if group == 'TC': status = 'Fuckup' loop = 0 elif group == 'Jock': status = 'Dickhead' loop = 0 elif group == 'None of the above': status = 'Noob' loop = 0 elif group == 'Programmers': status = 'Maddo' loop = 0 elif group == 'Nerd': status = 'Get a life' loop = 0 else: status = 'Not an option.'
print status raw_input("Press ENTER to quit.")
|
_________________ A typical class: show up, get rid of your homework, get new homework, leave. "Achievements in life are like footprints on a beach. If they are not stepped in high enough they can be washed away by a single wave." Dave Allie  |
|
 | |
ǤɌəƉ CDT Coder (In-Training)


Posts: 16 Join date: 2009-05-11 Age: 15
 | Subject: Re: My First Program Tue May 19, 2009 10:08 am | |
| thanks for the advice _________________  "To Hack Is To Live" |
|
 | |
Frost Administrator


Posts: 56 Join date: 2009-05-11 Age: 15 Location: Australia
 | Subject: Re: My First Program Tue May 19, 2009 10:15 am | |
| seems good, i prefer a longer but mroe failsafe strategy, so far so good. For your next program incorporate something a bit different and try and make it keyword/password activated/protected, should be sweet. Well done. Keep it up. _________________  |
|
 | |
ǤɌəƉ CDT Coder (In-Training)


Posts: 16 Join date: 2009-05-11 Age: 15
 | Subject: Re: My First Program Tue May 19, 2009 10:16 am | |
| well it is my first one  _________________  "To Hack Is To Live" |
|
 | |
xerion CDT Coder


Posts: 32 Join date: 2009-05-13 Age: 15 Location: Brizzie
 | Subject: Re: My First Program Tue May 19, 2009 10:27 am | |
| rofl dom ask GRED to do your stuff, password protected things Dave  _________________ A typical class: show up, get rid of your homework, get new homework, leave. "Achievements in life are like footprints on a beach. If they are not stepped in high enough they can be washed away by a single wave." Dave Allie  |
|
 | |
Frost Administrator


Posts: 56 Join date: 2009-05-11 Age: 15 Location: Australia
 | |
 | |
ǤɌəƉ CDT Coder (In-Training)


Posts: 16 Join date: 2009-05-11 Age: 15
 | Subject: Re: My First Program Wed May 20, 2009 8:14 am | |
| |
|
 | |
ǤɌəƉ CDT Coder (In-Training)


Posts: 16 Join date: 2009-05-11 Age: 15
 | Subject: Re: My First Program Wed May 20, 2009 10:16 am | |
| does anyone have any ideas of what else i could do with this | Code: | loop = 1 while loop == 1: print 'type what group you belong to (TC, Jock, Programmers, Nerds or None of the above)'
group = 'TC'and'Jock'and'None of the above'and'Programmers'and'Nerd'
group = raw_input("Enter group type: ")
if group == 'TC': status = 'Fuckup' loop = 0 elif group == 'Jock': status = 'Dickhead' loop = 0 elif group == 'None of the above': status = 'Noob' loop = 0 elif group == 'Programmers': status = 'Maddo' loop = 0 elif group == 'Nerds': status = 'Get a life' loop = 0 else: status = 'Not an option.'
print status raw_input('Press ENTER to exit.')
|
_________________  "To Hack Is To Live" |
|
 | |
Frost Administrator


Posts: 56 Join date: 2009-05-11 Age: 15 Location: Australia
 | Subject: Re: My First Program Thu May 21, 2009 6:54 am | |
| could try a break loop? lol _________________  |
|
 | |
|