Python Forum
Stuck with using lists to solve task
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stuck with using lists to solve task
#8
(Jan-16-2024, 08:44 AM)DPaul Wrote:
(Jan-16-2024, 08:33 AM)Gribouillis Wrote: All of this needs to be clarified.
I interpreted the problem as:
"...The fourth slave changed the state of every fourth door, and so on, up to the 100th ..."
The 5th every 5th door
The 6th every 6th door
....
The 100th every 100th door.
Or ?
Paul

Yeah, I came to the same conclusion.

My output is a little more "verbose":

Assuming that we don't use 'zero indexing', rather the first door is #1
Output:
Door: 1 - open Door: 4 - open Door: 9 - open Door: 16 - open Door: 25 - open Door: 36 - open Door: 49 - open Door: 64 - open Door: 81 - open Door: 100 - open
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
Stuck with using lists to solve task - by gery576 - Jan-15-2024, 11:03 AM
RE: Stuck with using lists to solve task - by DPaul - Jan-16-2024, 06:57 AM
RE: Stuck with using lists to solve task - by DPaul - Jan-16-2024, 08:44 AM
RE: Stuck with using lists to solve task - by rob101 - Jan-16-2024, 12:54 PM
RE: Stuck with using lists to solve task - by DPaul - Jan-16-2024, 06:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to solve this task? DERO 2 1,873 Dec-06-2021, 07:15 PM
Last Post: BashBedlam
  simple task with lists... Maxwell123 3 2,449 Jun-27-2020, 01:00 PM
Last Post: GOTO10
  I need help to solve this task using while statement rico4pepe 6 9,365 Apr-02-2020, 11:34 AM
Last Post: pyzyx3qwerty

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020