๐Ÿ Python Cheatsheet

Fun, editable, runnable. Change the code, then press โ–ถ Run!

๐Ÿ–จ๏ธ print โ€” say something

Shows text on the screen.

๐Ÿ“ฆ variables โ€” remember things

A box with a name that holds a value.

โŒจ๏ธ input โ€” ask a question

A pop-up appears. Type your answer and press OK.

Input is always text. Use int() to turn it into a number you can do maths with.

๐Ÿ” loops โ€” do it again and again

Repeat code without typing it lots of times.

๐Ÿ”€ if โ€” make a choice

Do different things depending on the answer.

๐ŸŽฒ random โ€” surprise me!

Pick a random whole number. Great for dice and games. Run it a few times!

Pick a random item from a list.

๐Ÿงฎ maths โ€” count and calculate

Python is a great calculator.

โš–๏ธ comparisons โ€” true or false?

These questions answer True or False. They are what if uses to decide.

You can compare words too. Python checks them letter by letter, like a dictionary.

๐Ÿ”— boolean expressions โ€” combine questions

Join True/False values with and, or, not.

They are handy inside if.

๐Ÿ Loading Pythonโ€ฆ