I am following https://automatetheboringstuff.com/2e/chapter1 CHAPTER 0 AND OVERALL OBSERVATIONS. Download Python from Python.org and mu from https://codewith.mu/en/download . For me the latest version of mu does not work on my mac. In chapter0, it says how to figure out exactly whether you have a 64-bit or 32-bit OS. In terminal, do python3 . In IDLE, I went to IDLE -> Preferences -> Keys and chose history-previous and history-next and set them to up arrow and down arrow. Code seems MUCH more stable and predictable in IDLE than in terminal for some reason. In IDLE you just do run -> run module. The indentation thing seems very inflexible. It's unusual how you cannot end functions and for loops with brackets but instead need returns. CHAPTER 1. 2+3 7*5 12 // 2.2 # just the integer part of the division. 12 % 2 # just the remainder. 12 % 2.2 # does weird stuff. 4 ** 3 # exponents. The order is just like math. Parentheses work. the_world_is_flat = True if the_world_is_flat: print("Be careful not to fall off!") You need the indentation. += works as in C. x = 2 x += 1 ## 3. single quotes are used for strings. Doublequotes seem to work for me too. 'Alice' + 'Bob' 'AliceBob' 'Alice' * 5 'AliceAliceAliceAliceAlice' input() lets the user input a value. len() is the length. str() converts a number into a string. # This program says hello and asks for my name. print('Hello, world!') print('What is your name?') myName = input() print('It is good to meet you, ' + myName) print('The length of your name is:') print(len(myName)) print('What is your age?') myAge = input() print('You will be ' + str(int(myAge) + 1) + ' in a year.') As with R, if you just cut and paste all this into the terminal window of Python it won't work as it will run line by line. myName will be 'print('It is good to meet you, ' + myName)'. int(4.2) 4 ## int is weird. int('4') works but int('4.2') doesn't. float() works nicely. float(4.2) float('4.2') CHAPTER 2. Like in C, the comparison operators are ==, !=, >= etc. and, or, and not are logical. You don't seem to need parentheses with if, in Python. if statement else: You have to have a colon and an indented block of code on the NEXT line. elif is only executed if the preceding thing was false. mynum = int(input()) if mynum < 5: print("Your number is small") elif mynum < 7: print("Your number is medium") elif mynum <= 8: print("Your number is large") else: print("Your number is huge") You don't absolutely need the intentation and new lines. Without the else, an if statement needs a blank line after it to run! i = 1 while(i < 10): print("Your number is ", i,".\n") if i == 7: break i = i + 1 CTRL-C stops an infinite loop. continue makes it go back to the beginning of the while loop. for i in range(10): print("Your number is",i,"\n") In a for loop, continue will pass to the next value of i. for i in range(10): if i == 5: continue print("Your number is",i,"\n") for i in range(10,3,-1): print("your number is ",i) import random, sys, os, math ## Modules print(random.randint(1, 10)) Enter the following source code into the file editor, and save the file as guessTheNumber.py: # This is a guess the number game. import random secretNumber = random.randint(1, 20) print('I am thinking of a number between 1 and 20.') # Ask the player to guess 6 times. for guessesTaken in range(1, 7): print('Take a guess.') guess = int(input()) if guess < secretNumber: print('Your guess is too low.') elif guess > secretNumber: print('Your guess is too high.') else: break # This condition is the correct guess! if guess == secretNumber: print('Good job! You guessed my number in ' + str(guessesTaken) + ' guesses!') else: print('Nope. The number I was thinking of was ' + str(secretNumber)) RUNNING SCRIPTS AND MODULES. I made the file printie.py on the Desktop. It contains this. # This prints some numbers. for i in range(0,10): if i == 6: continue elif i < 5: print("low number", i) else: print("high number", i) First you have to set your directory. One way to do this is in terminal. cd Desktop ls ## make sure printie.py appears. python3 printie.py You can also do python3 printie.py >> output.txt ## to save output to a file. Another way is to change directories in Python. This says how to change directories. https://note.nkmk.me/en/python-os-getcwd-chdir import os os.getcwd() os.chdir("/Users/rickpaikschoenberg/Desktop") import printie This https://realpython.com/run-python-scripts/#scripts-vs-modules says more on how to run scripts and modules. CHAPTER 3. Functions. def mynumb(): print("What is your number?") i = input() print("Your number is ",i) mynumb() You need the return after the function for python to know it is over. You need () after def mynumb so it knows it is a function. If a function like print returns nothing, what it actually returns is the value None. Variables defined in functions are all local by default. To change a global variable within a function, do global x def x(): global y y = 3 y = 2 x() y ## it will output 3. You can use try and except except ZeroDivisionError: print('Error: Invalid argument.') except KeyboardInterrupt: sys.exit()