[pydotorg-www] Unable to answer and write a difficult program
mats at wichmann.us
Fri Oct 27 11:44:49 EDT 2017
On 10/27/2017 08:04 AM, Shivangi Dalmia wrote:
> The question is -Write a script that repeatedly asks the user to enter a 'customization option' to be added to an order of sunglasses. When the user enters nothing, the script should stop asking for new 'customization options', and display a message listing the customization options and stating how many customization options there are.
> Here's what a sample run might look like:
> Add as many customization options to your order of sunglasses as you want.
> When you're done, enter 'nothing'.
> What do you want add to the sunglasses now? titanium mechanism
> What do you want add to the sunglasses now? ear socks
> What do you want add to the sunglasses now? sub-etha sens-o-matic
> What do you want add to the sunglasses now? nothing
> There are 3 customization options added to the sunglasses:
> ['titanium mechanism', 'ear socks', 'sub-etha sens-o-matic’]
> the number of customization options for the sunglasses order, and
> a lists all the customization options added to the sunglasses order.
> You need to use the function definition
> The print and input functions cannot be used in this program
> I am unable to solve the program. It would be extremely helpful if I could get its solution.
This would be a really good question to take up at the Python tutor
mailing list. See:
to sign up.
The list members will ask you to post some code you have already
attempted, so please do that: show what you have tried and how it has
failed, rather than just asking "can I get the solution". Since it
sounds like a homework problem you will probably get guidance, but not
Best of luck, and welcome to Python!
More information about the pydotorg-www