One has your typical if statement; your pythoness is : and indent
if x == "letter":
1234y=written
That is the Boolean, followed by a semicolon : and a <newline>
indent 4 spaces, if Boolean is true then assign written to variable y
if x == "letter":
y = written
If boolean:
# doing a thing
elseif 2boolean:
# doing a thing2;
else:
# mop up
Typical Booleans that work in strings and numbers
== !=
And more Booleans for numeric or integers and floats are
> < >= <=
Typical operands that work on strings and numbers
+ *
5 + 5 will be 55 if done on a string, dak * 3 will be dakdakdak.
And more numeric operands
– /
You can google or search the Python Documentation for the word “operands” for actions to variables that match arithmetic
x ** 2 for power of 2 or exponential.
I am sure there is probably a logarithmic function for going the other way.
x % 3 for remainder or modulus
is 0 when x is 9 since it evenly divides with no remainder or is 2 when x is 11.
You can google or search for the word “Boolean Conditional” or each word separately where you can get some additional choices to if statements like the case statement.
and for the word “Operators”, we sort of looked only at single variables compared to values, there are also things like Logical Operators and, or, not.
The world of lists, does a value appear in a list.
"banana" in x if x was a string listing of fruit or "baker" in "bakermayfield" is True for a str.
A very common conditional functional "does file exist"; common if you like to write pre-checks in your script or like to write your own help or usage messages, if a file is required to for script to work.
There is whole bunch more, but this is a good start, very similar to ruby and bash, so python has anything you are used to using, just has its own unique syntax which I tried to touch on here to get moving in right direction.
Below is great use of lists, it is always important to know how to split a list. And before we learn expression[2] is expression was dog would be g, which is location in a string.
expression = input("Expression: ")
x,y,z = expression.split(" ")
Strings can be deciphered or taken apart with “in” or location in string express[3].
Lists can be taken apart with split, default delimiter is space, could be a comma too.
Numerics tend to be isolated variables, which I mean float(“x”, “y”) is sloppy, maybe y is a letter. Better to keep it nx = float(x), manipulate numbers similar to simple arithmetic IRL.
Or always important to be able to pull things apart. In the future we will get to hashes and arrays where location is more important.