Python Forum
Need help with List of Lists
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with List of Lists
#3
i have tried the following:

a = [-1, 2, -2, 3, 41, 38, 22, 10, -1, 3]
b = [40, 30, 20, 10]
        
k=0
for i in range(0,len(a)):       
    k = k +1
    ab = a[k:(k+4)]
    
    if len(ab) != 4:
        break  
    else:
        print(ab)
This gives me lists of lists i need from a, but now i am stuck on how to actually multiple it by the values in b
Reply


Messages In This Thread
Need help with List of Lists - by johnissa - Apr-21-2018, 01:23 AM
RE: Need help with List of Lists - by Larz60+ - Apr-21-2018, 03:50 AM
RE: Need help with List of Lists - by johnissa - Apr-21-2018, 04:11 AM
RE: Need help with List of Lists - by Larz60+ - Apr-21-2018, 05:10 AM
RE: Need help with List of Lists - by johnissa - Apr-21-2018, 05:35 AM
RE: Need help with List of Lists - by Larz60+ - Apr-21-2018, 05:45 AM
RE: Need help with List of Lists - by johnissa - Apr-21-2018, 07:24 AM
RE: Need help with List of Lists - by Larz60+ - Apr-21-2018, 09:47 AM
RE: Need help with List of Lists - by pyghorz - Apr-22-2018, 04:09 PM
RE: Need help with List of Lists - by Larz60+ - Apr-22-2018, 04:31 PM
RE: Need help with List of Lists - by pyghorz - Apr-22-2018, 04:38 PM
RE: Need help with List of Lists - by Larz60+ - Apr-22-2018, 06:11 PM
RE: Need help with List of Lists - by ljmetzger - Apr-22-2018, 06:24 PM
RE: Need help with List of Lists - by Larz60+ - Apr-22-2018, 09:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if a list exists in given list of lists Daniel94 2 2,322 Apr-07-2020, 04:54 PM
Last Post: deanhystad
  List of lists manipulation Stahlios 5 4,256 Apr-18-2018, 07:43 PM
Last Post: Stahlios
  List of lists MarkLogan 3 87,276 Feb-28-2018, 11:21 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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