DynamicPL
-
iterator, iterable, iteration, iterator protocol, generator functions, generator expressions, and lazy evaluationDynamicPL/Python 2019. 10. 22. 08:44
1. Overview In Python, iterable and iterator have specific meanings. How the iteration in Python works under the hood What are iterables and iterators and how to create them What is the iterator protocol What is a lazy evaluation What are the generator functions and generator expressions 2. Description 2.1 Loop 2.1.1 For Loop Python has something called for loop, but it works like a foreach loop..
-
Asterisk(*) of PythonDynamicPL/Python 2019. 10. 18. 16:15
1. Overview There are 4 cases for using the asterisk in Python. For multiplication and power operations. For repeatedly extending the list-type containers. For using the variadic arguments. (so-called “packing”) For unpacking the containers. Let’s look at each case. 2. Description 2.1 For multiplication and power operations >>> 2 * 3 6 >>> 2 ** 3 8 >>> 1.414 * 1.414 1.9993959999999997 >>> 1.414 ..
-
Data Structure in PythonDynamicPL/Python 2019. 10. 18. 14:54
1. Overview There are quite a few data structures available. The builtins data structures are lists, tuples, dictionaries, strings, sets, and frozensets. Lists, strings, and tuples are ordered sequences of objects. Unlike strings that contain only characters, list and tuples can contain any type of objects. Lists and tuples are like arrays. Tuples like strings are immutables. Lists are mutables ..
-
Array OperationsDynamicPL/Javascript 2019. 9. 22. 09:05
1. Overview Summarize array operations, such as pop, push, shift, unshift, splice, slice, and split in javascript 2. Description var a = [1, 2, 3]; var b = a.unshift(0); console.log(a); //[0, 1, 2, 3] console.log(b); //4 var a = [1, 2, 3]; var b = a.shift(); console.log(a); //[2, 3] console.log(b); //1 var b = a.shift(2); console.log(a); //[3] console.log(b); //2, only one element is shifted var..