Answers for "assign elements of list to variables python"

2

array to two variables python

>>> a,b,c,d = [1,2,3,4]
>>> a
1
>>> b
2
>>> c
3
>>> d
4
Posted by: Guest on November-07-2020
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 "assign elements of list to variables python"

Python Answers by Framework

Browse Popular Code Answers by Language