Difficulty dealing with this task: While Loop (Python) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difficulty dealing with this task: While Loop (Python)

I am having serious difficulty in dealing with this task and trying to understand it. I've been trying to figure out how to really solve it. Please what could be the way around it? https://www.sololearn.com/learning/1073

6th Feb 2022, 10:30 AM
Kizito Onyema
Kizito Onyema - avatar
3 Answers
+ 2
You can approach the problem with 1 while loop * loop while dats > 0 * on each iteration, double items and then decrease days by 1 * print the result once after the loop
6th Feb 2022, 10:52 AM
Lisa
Lisa - avatar
+ 1
Please mention the course and the task number. Show your code attempt so we can help you
6th Feb 2022, 10:40 AM
Lisa
Lisa - avatar
0
Python 26.2 Practice Code Attempt: items = int(input()) days = int(input()) #your code goes here i = 0 j = 0 while i <= days: while j <= items: print(items) items*=2 i+=days
6th Feb 2022, 10:47 AM
Kizito Onyema
Kizito Onyema - avatar