Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lists + Empty Lists
#10
(Mar-22-2021, 07:40 PM)Axel_Erfurt Wrote: You have a list with all days and you want 2 lists with weekdays and weekend days ?

I wrote it before

weekdays = days[:5]
weekends = days[5:]

Thank you again for replying, this is what I'm trying to do:

Create a list containing the days of the week from Monday to Sunday and two empty lists weekday = [ ] and weekend = [ ]. Allocate each element from the list containing the days to the appropriate list: either weekday or weekend.

Print the weekdays from the weekday list in the order from Monday to Friday.
Print the weekend days from the weekend list in the order Saturday, Sunday.
Reply


Messages In This Thread
Lists + Empty Lists - by Pytho13 - Mar-22-2021, 06:39 PM
RE: Lists + Empty Lists - by Axel_Erfurt - Mar-22-2021, 06:47 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-22-2021, 06:48 PM
RE: Lists + Empty Lists - by Axel_Erfurt - Mar-22-2021, 06:52 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-22-2021, 06:53 PM
RE: Lists + Empty Lists - by Larz60+ - Mar-22-2021, 06:59 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-22-2021, 07:07 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-22-2021, 07:18 PM
RE: Lists + Empty Lists - by Axel_Erfurt - Mar-22-2021, 07:40 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-22-2021, 08:20 PM
RE: Lists + Empty Lists - by Axel_Erfurt - Mar-22-2021, 08:30 PM
RE: Lists + Empty Lists - by deanhystad - Mar-22-2021, 08:49 PM
RE: Lists + Empty Lists - by Pytho13 - Mar-23-2021, 11:40 AM
RE: Lists + Empty Lists - by snippsat - Mar-23-2021, 01:09 PM
RE: Lists + Empty Lists - by Larz60+ - Mar-23-2021, 09:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Appending lists into lists from function is not working for me BoredBannana 2 1,160 Oct-25-2024, 05:18 PM
Last Post: deanhystad
  Nested Lists & Dictionaries Hudjefa 5 1,329 Sep-23-2024, 08:20 PM
Last Post: DeaD_EyE
Sad The issue with compare 2D lists przonak007 18 3,321 Jul-17-2024, 07:31 AM
Last Post: Pedroski55
  Compare lists w_i_k_i_d 6 1,642 May-23-2024, 07:23 PM
Last Post: deanhystad
Question Using Lists as Dictionary Values bfallert 8 2,209 Apr-21-2024, 06:55 AM
Last Post: Pedroski55
  problem with print lists MarekGwozdz 4 1,632 Dec-15-2023, 09:13 AM
Last Post: Pedroski55
  python convert multiple files to multiple lists MCL169 6 3,261 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  Lists blake7 6 2,187 Oct-06-2023, 12:46 PM
Last Post: buran
  Trying to understand strings and lists of strings Konstantin23 2 1,755 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Why do the lists not match? Alexeyk2007 3 1,636 Jul-01-2023, 09:19 PM
Last Post: ICanIBB

Forum Jump:

User Panel Messages

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