Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I'm creating this program in python that calculates you total cost according to how much you choose. so the program is pizza delivery, and the user has to choose their choice of pizza out of the menu. what I cant figure out is that how to tell python that whatever the users first,second and third choice is, the cost will be 3 dollars and the rest would be 5 dollars. what I mean in more dept would be that how do i tell python that the users 1st,2nd,3rd choice/input = $3.
I tried writing: menu[0:3] = 3 but that just changes the food in the array/list.
Try this function:
def price(choice): if choice <= 3: cost = 3 else: cost = 5 return cost price(4) > 5
You can create a counter variable for tracking inputs, increment it after taking each input. And then in the price section of your code, use an if statement to set price to 3 if counter < 4, else set price to 5.
# Create counter variable counter = 0 # Taking user input code here counter = counter + 1 # Later when setting price in code if counter < 4: price = 3 else: price = 5
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.