Python | Sololearn: Learn to code for FREE!

-2

Python

You have a magic box that doubles the count of items you put in every day. The given program takes the initial count of the items and the number of days as input. Task Write a program to calculate and output items' count on the last day. My code is: items = int(input()) days = int(input()) i = 1 x = days while i <= x: items *= 2 i = i + 1; print(items)

9/18/2021 8:13:46 PM

Nida Hanfi

5 Answers

New Answer

+2

Nida Hanfi Do you have a concept for us to look at, else it sounds like you want us to do your homework. Please attach a code attempt so we may guide you

+1

Please, firstly show your attempt. After that ask what your problem is clearly. Thanks for understanding. Happy coding!

0

https://www.sololearn.com/discuss/333866/?ref=app https://www.sololearn.com/discuss/1316935/?ref=app

0

i am sorry I posted my code can you please guide me as I am stuck on this Question if you know Please

0

Nida Hanfi Try this items = int(input()) days = int(input()) while days > 1: items *= 2 days -=1; print(items) if you put in 2 items for 3 days day 2 -> 4 items day 3 -> 8 items 10 items for 4 days day 2 -> 20 day 3 -> 40 day 4 -> 80