diff --git a/youngjin.han/learning-node02-2020.org b/youngjin.han/learning-node02-2020.org index 38bce79..7296fb2 100644 --- a/youngjin.han/learning-node02-2020.org +++ b/youngjin.han/learning-node02-2020.org @@ -1,6 +1,14 @@ +* 2020-06-08 +*** Python #7: +**** TODO Lecture content + - Same structure as "Python #2" + - Exercises 37-39 +**** Lecture material + - Available on https://cloud.ungleich.ch/s/435FyfrQyEq6oF3 * 2020-06-01 *** Python applying learnings from 1..6 -**** Lecture notes +**** DONE Lecture notes + CLOSED: [2020-06-02 화 11:21] - Previous topics covered: - Printing - Formatting diff --git a/youngjin.han/python-the-hard-way/ex38.py b/youngjin.han/python-the-hard-way/ex38.py new file mode 100644 index 0000000..db09084 --- /dev/null +++ b/youngjin.han/python-the-hard-way/ex38.py @@ -0,0 +1,23 @@ +ten_things = "Apples Oranges Crows Telephone Light Sugar" + +print("Wait there are not 10 things in that list. Let's fix that.") + +stuff = ten_things.split(' ') +more_stuff = ["Day", "Night", "Song", "Frisbee", + "Corn", "Banana", "Girl", "Boy"] + +while len(stuff) != 10: + next_one = more_stuff.pop() + print("Adding: ", next_one) + stuff.append(next_one) + print(f"There are {len(stuff)} items now.") + +print("There we go: ", stuff) + +print("Let's do some things with stuff.") + +print(stuff[1]) +print(stuff[-1]) # whoa! fancy +print(stuff.pop()) +print(' '.join(stuff)) # what? cool! +print('#'.join(stuff[3:5])) # super stellar! diff --git a/youngjin.han/python-the-hard-way/result.txt b/youngjin.han/python-the-hard-way/result.txt new file mode 100644 index 0000000..b50bbfe --- /dev/null +++ b/youngjin.han/python-the-hard-way/result.txt @@ -0,0 +1 @@ +input error : input string = ['1', 'q'] diff --git a/youngjin.han/python.org b/youngjin.han/python.org index 7a8d03f..fbb709d 100644 --- a/youngjin.han/python.org +++ b/youngjin.han/python.org @@ -1,4 +1,15 @@ +* 2020-06-08 +** note + - ex37.py + - none + - ex38.py + - ten_things.split(' ') == split(ten_things, ' ') + - more_stuff.pop() == pop(more_stuff) + - stuff.append(next_one) == append(stuff, next_one) + - ex39.py + - * 2020-05-29 +** note - ex32.py - remove, insert, index, append, '+' and del - ex33.py