開発環境
- macOS High Sierra - Apple
- Emacs (Text Editor)
- Python 3.6 (プログラミング言語)
入門 Python 3 (Bill Lubanovic (著)、斎藤 康毅 (監修)、長尾 高弘 (翻訳)、オライリージャパン)の3章(Pyの具: リスト、タプル、辞書、集合)、3.8(復習問題)8、9.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3 print('3-8') surprise = ['Groucho', 'Chico', 'Harpo'] print('3-9.') surprise[-1] = surprise[-1].lower() print(surprise) surprise = surprise[::-1] print(surprise) surprise[0] = surprise[0].capitalize() print(surprise)
入出力結果(Terminal, Jupyter(IPython))
$ ./sample3.py 3-8 3-9. ['Groucho', 'Chico', 'harpo'] ['harpo', 'Chico', 'Groucho'] ['Harpo', 'Chico', 'Groucho'] $
1 コメント :
Tanakh
first book of Samuel has fifty mistakes.
second book of Samuel has seventy mistakes.
first book of Kings has eighty mistakes.
second book of Kings has one hundred mistakes.
Tanakh has three hundred mistakes in four books.
Book of Ezra has thirty mistakes.
Deuteronomy has sixty mistakes.
Tanakh has three hundred ninety mistakes in six books.
コメントを投稿