Jump to content

Python Help

CJPowell27

Hey guys I have another question for you.  I have to have a program that does somethin like this

1  – Exit

2  – Display all the car models and number in inventory.

3  – Add a car model name and number to inventory.

4  – Delete a car model name and it’s number from inventory.

5  – Change the number in inventory of a car model. 

this is the code i have but when I run the program returns an invalid syntax and highlights the colons

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to comment
Share on other sites

Link to post
Share on other sites

Hey guys I have another question for you.  I have to have a program that does somethin like this

1  – Exit

2  – Display all the car models and number in inventory.

3  – Add a car model name and number to inventory.

4  – Delete a car model name and it’s number from inventory.

5  – Change the number in inventory of a car model. 

this is the code i have but when I run the program returns an invalid syntax and highlights the colons

http://pastie.org/10512099

There's a missing parentheses at the end of line 38.

Link to comment
Share on other sites

Link to post
Share on other sites

There's a missing parentheses at the end of line 38.

That made the program launch now i need to figure out how to stop the infinite loop and get the program to be able to go through multiple inputs lol thanks

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to comment
Share on other sites

Link to post
Share on other sites

There's a missing parentheses at the end of line 38.

*claps* The most blunt answer ever.

 

Also, op would you be nice enough to select his answer as being best answer so that it is solved. (It saves people from going on the post)

Link to comment
Share on other sites

Link to post
Share on other sites

That made the program launch now i need to figure out how to stop the infinite loop and get the program to be able to go through multiple inputs lol thanks

 

Well, right now you have it set to repeat that initial print statement over and over until choice != 1, but choice can't be set to 1 until after you get past the loop. So, it just repeats infinitely. Everything you want to be looped needs to be inside the loop, which in this case is the entire rest of the program :)

Link to comment
Share on other sites

Link to post
Share on other sites

Well, right now you have it set to repeat that initial print statement over and over until choice != 1, but choice can't be set to 1 until after you get past the loop. So, it just repeats infinitely. Everything you want to be looped needs to be inside the loop, which in this case is the entire rest of the program :)

Do you have any idea what line I should add to have the program ask the question for users input multiple until they select 1.  

As of right now as soon as i finish entering the input of the model number and amount of cars the program thinks it's done and exits.

*claps* The most blunt answer ever.

 

Also, op would you be nice enough to select his answer as being best answer so that it is solved. (It saves people from going on the post)

I would if his answer helped me complete the program.  I will be sure to do so as soon as I no longer need help :)

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×