More on this book
Community
Kindle Notes & Highlights
by
Eric Matthes
Started reading
November 1, 2018
language will bring you luck.
In Python, you can write the Hello World program in one line: print("Hello world!") Such a simple program
$ python
$ python3
Installing a Text Editor Geany
Geany is configured to use the correct version.
Build ▸ Set Build Commands.
python3 -m py_compile "%f"
python3 "%f"
line in the terminal session:
Python on Windows
entering command into the Start
enter python in lowercase.
Python 3 button, which should automatically start downloading the correct installer for your system.
Starting a Python Terminal Session
C:\> C:\Python35\python
Running Python in a Terminal Session
Installing a Text Editor Geany is a simple text editor: it’s easy to install,
1.25_setup.exe installer
Configuring Geany
C:\Python35\python -m py_compile "%f" Your path might be a little different,
Running Python Programs from a Terminal Most of the programs you write in your text editor you’ll run directly from the editor, but sometimes it’s useful to run programs from a terminal instead.
On Windows
➊ C:\> cd Desktop\python_work
python_work ➋ C:\Desktop\python_work> dir
hello_world.py ➌ C:\Desktop\python_work> pytho...
This highlight has been truncated due to consecutive passage length restrictions.
a variable named message.
message = "Hello Python Crash Course world!"
Naming and Using Variables
Strings
"This is a string."
'This is also a string.'
print(name.title())
Ada Lovelace
variable name. The method title() appears after the variable in the print() statement. A method is an action that Python can perform on a piece of data.
Every method is followed by a set of parentheses, because methods often need additional information to do their work. That information is provided inside the parentheses. The title() function doesn’t need
when you want to delete an item from a list and not use that item in any way, use the del statement;
you remove it, use the pop() method.
The remove() method deletes only the first occurrence of the value you specify.
sort() Method
len() function.
use a for loop to print
for magician in magicians:
for loops that you can choose any name you want for the temporary variable that holds each value in the list.
for item in list_of_items:
Every indented line following the line for magician in magicians is considered inside the loop, and each indented line is executed once for each value in the list.
Python uses indentation to determine when one line of code is connected to the line above
Basically, it uses whitespace to force you to write neatly formatted code
Forgetting the Colon
The colon at the end of a for statement tells Python to interpret the next line as the start of a loop.

