52769/create-vars-based-on-number-of-elements-on-the-list
Hey @Ashish, you can try something like this:
list = [1, 2, 3, 4] d = {'var%d' % el: None for el in list} d {'var4': None, 'var1': None, 'var3': None, 'var2': None}
Hello, The len() function can be used with several different ...READ MORE
items = [] items.append("apple") items.append("orange") items.append("banana") len(items) #use the ...READ MORE
The len() function can be used with several different ...READ MORE
The print() is getting called multiple times ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
To count the number of elements of ...READ MORE
There are several options. Here is a ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.