Answers for "how to assign a list to a variable in python"

0

assign elements of list to variables python

l = [1, 2, 3, 4]

num1, num2, num3, num4 = l

'''
printing the variables will return

num1: 1
num2: 2
num3: 3
num4: 4
'''
Posted by: Guest on May-04-2021

Code answers related to "how to assign a list to a variable in python"

Python Answers by Framework

Browse Popular Code Answers by Language