5576/enlarging-a-list-using-functions-using-append-and-extend
Let me illustrate this with an example -
l = [1, 2, 3, 4, 5] >>> l [1, 2, 3, 4, 5] >>> e = [6, 7] >>> l.append(e) >>> l [1, 2, 3, 4, 5, [6, 7]]
>>> l = [1, 2, 3, 4, 5] >>> e = [6, 7] >>> l.extend(e) >>> l [1, 2, 3, 4, 5, 6, 7]
The in-built variables and functions are defined ...READ MORE
Yes it is possible. You can refer ...READ MORE
Hi, num_words_list = len(original_str.split()) original_str.split() - split words in ...READ MORE
Appends object at the end. x = [1, ...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
Here's a generator that yields the chunks ...READ MORE
To count the number of appearances: from collections ...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.