hi notes
a hashtag is also called a pound(preferably), it hides lines of code when you eventually pull it. "Anything after the pound is ignored by python
= (equal sign) gives data numbers, strings, etc names (aka variables) The = (single-equal) assigns the value on the right to a variable on the left. The == (double-equal) tests whether two things have the same value.
Every time you put " (double quotes) around a piece of text you have been making a string. A string is how you make something that your program might give to a human. You print strings, save strings to files, send strings to web servers, and many other things.
In Python source code, an f-string is a literal string, prefixed with 'f', which contains expressions inside braces. The expressions are replaced with their values.
A string is usually a bit of text you want to display to someone or “export” out of the program you are writing. Python knows you want something to be a string when you put either " (double-quotes) or ' (single-quotes) around the text. You saw this many times with your use of print when you put the text you want to go inside the string inside " or ' after the print to print the string.
if formatting is still confusing, check exercise seven, seven_k and eight.
using backslash + n puts a new line character into a string "This \ (backslash) character encodes difficult-to-type characters into a string."
ex11.py: Warning! We put a end=' ' at the end of each print line. This tells print to not end the line with a newline character and go to the next line.
ex12.py: When you typed input() you were typing the ( and ) characters, which are parenthesis characters. This is similar to when you used them to do a format with extra variables, as in f"{x} {y}". For input you can also put in a prompt to show to a person so he knows what to type. Put a string that you want for the prompt inside the () so that it looks like this: y = input("Name?") This prompts the user with “Name?” and puts the result into the variable y. This is how you ask someone a question and get the answe
important: page 69 of pdf!!! about argv!!!!!!!!!!
Functions do three things:
- They name pieces of code the way variables name strings and numbers.
- They take arguments the way your scripts take argv.
- Using 1 and 2, they let you make your own "mini-scripts" or "tiny commands."
good exercise/explanation for for-loops, .append, range and lists: ex32.py
ordinal == ordered, 1st; cardinal == cards at random, 0.
ex52: i am at my FINAL excercise!! this has been a ride, i will hopefully be able to run memeweb on a browser by tonight :)!