You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -380,6 +380,23 @@ Python is more like java and bit cumbersome, but it leads to a better design. Py
380
380
381
381
There are 2 optional clauses used in try...except statements: 1. else clause: It is useful for code that must be executed when the try block doesn't create any exception2. finally clause:Its is useful for code that must be executed irrespective of whether an exception is generated or not.
382
382
383
+
384
+
#### Is it possible to assign multiple var to values in list?
385
+
A: The multiple assignment trick is a shortcut that lets you assign multiple variables with the values in a list in one line of code. So instead of doing this:
386
+
```
387
+
>>> cat = ['fat', 'orange', 'loud']
388
+
>>> size = cat[0]
389
+
>>> color = cat[1]
390
+
>>> disposition = cat[2]
391
+
```
392
+
393
+
Do this:
394
+
```
395
+
cat = ['fat', 'orange', 'loud']
396
+
size, color, disposition = cat
397
+
```
398
+
399
+
383
400
#### What is List Comprehensions feature of Python used for?
384
401
385
402
List comprehensions help to create and manage lists in a simpler and clearer way than using map(), filter() and lambda. Each list comprehension
0 commit comments