Answers for "python unpack list"

1

list unpacking python

def fun(a, b, c, d): 
    print(a, b, c, d) 
  
# Driver Code 
my_list = [1, 2, 3, 4] 
  
# Unpacking list into four arguments 
fun(*my_list)
Posted by: Guest on May-10-2020
0

unpack list python

l = [0, 1, 2]

a, b, c = l

print(a)
print(b)
print(c)
# 0
# 1
# 2
Posted by: Guest on June-07-2021
0

unpack list python

# unpack a list python:
list = ['red', 'blue', 'green']

# option 1
red, blue = colors

# option 2
*list
Posted by: Guest on August-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language