« All Events
5:30 PM – Intro To Python – Gamas
November 29, 2022 @ 5:30 pm - 6:30 pm
Today We Did
- We finished Nov8_ShoppingCart.py program
Homework
- Create a new file Nov29_RobuxShoppingCart.py. We are going to create something similar to Nov8_ShoppingCart.py, so if you are stuck with the below program, look at Nov8_ShoppingCart.py to see if you can get some sample codes.
- Create a new variable called robux_balance = 300
- Create a program that will continuously display the following menu. When the user enters “5”, stop the loop.
- If the user enters other than “1”, “2”, “3”, “4” or “5”, print “invalid selection”.
Welcome to Robux Bank, you have 300 robux in the beginning.
What do you want to do:
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 123123
invalid selection
What do you want to do:
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: asdfasdf
invalid selection
What do you want to do:
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 5
You have purchased the following items:
Your remaining Robux balance is 300 Robux.