\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{River L. (Tamaranth)} \pdfinfo{ /Title (python-basics.pdf) /Creator (Cheatography) /Author (River L. (Tamaranth)) /Subject (Python Basics Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{617CD4} \definecolor{LightBackground}{HTML}{F5F6FC} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Python Basics Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{River L. (Tamaranth)} via \textcolor{DarkBackground}{\uline{cheatography.com/42882/cs/46556/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}River L. (Tamaranth) \\ \uline{cheatography.com/tamaranth} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 15th June, 2025.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{`print` Function \& Formatting}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{{\emph{Syntax}}}} & {\bf{{\emph{Explanation}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `print('Hello Johnny.')` & Print string as output \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `print('Hello{\bf{\textbackslash{}n}}Johnny.')` & Print "Johnny." on a new line \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} `print({\bf{f}}'Hello \{name\}.')` & {[}F-string{]} Allows inserting variables \& expressions. \tn % Row Count 8 (+ 3) % Row 4 \SetRowColor{LightBackground} `print(f'\{payment{\bf{:.2f}}\}')` & {[}Precision designator{]} Value is rounded to 2 decimal places in output \& displayed as floating-point number. \tn % Row Count 14 (+ 6) % Row 5 \SetRowColor{white} `print(f'\{number{\bf{:.2e}}\}')` & Value is rounded to 2 decimal places in output \& displayed in scientific notation. \tn % Row Count 19 (+ 5) % Row 6 \SetRowColor{LightBackground} `print(f'\{number{\bf{:,}}\}')` & {[}Comma separator{]} Displays commas in large numbers (e.g. "10,000"). \tn % Row Count 23 (+ 4) % Row 7 \SetRowColor{white} `print(f'\{discount{\bf{:.0\%}}\}')` & Converts decimal to percent in output. \tn % Row Count 25 (+ 2) % Row 8 \SetRowColor{LightBackground} `print(f'\{number{\bf{:10}}\}')` & Sets minimum field width of 10. \tn % Row Count 27 (+ 2) % Row 9 \SetRowColor{white} `print(f'\{number{\bf{:\textasciicircum{}}}\}')` & {\bf{\textless{}}} = left align\{\{nl\}\}{\bf{\textgreater{}}} = right align\{\{nl\}\}{\bf{\textasciicircum{}}} = center align \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{`print` Function \& Formatting (cont)}} \tn % Row 10 \SetRowColor{LightBackground} `num = 12345.6789`\{\{nl\}\}`print(f'Num is \{num:\textgreater{}10,.2f\}')` & \{\{nobreak\}\}Example with all designators.\{\{nl\}\}Output: `Num is 12,345.68` \tn % Row Count 4 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Order of format designators:\{\{nl\}\}`{\emph{variable{\bf{}}:}}{[}{\emph{alignment}}{]}{[}{\emph{width}}{]}{[}{\bf{,}}{]}{[}{\bf{.}}{\emph{precision}}{]}{[}{\emph{type}}{]}`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{if Statements}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{if}} {\emph{condition}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Loops}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#} \newline \# {\bf{while}}: for condition-controlled loops, \newline \# \& count-controlled loops (w/ added steps) \newline \newline \# Basic while loop: \newline {\bf{while}} {\emph{n}} {\bf{\textless{}}} 5{\bf{:}} \newline {\bf{print('}}Value is less than 5{\bf{')}} \newline {\emph{n}} {\bf{+=}} 1 \newline \newline \# Count-controlled while loop: \newline {\emph{n}} {\bf{= 0}} \#{\emph{Initialization}} \newline {\bf{while}} {\emph{n}} {\bf{\textless{}}} 5{\bf{:}} \#{\emph{Comparison}} \newline {\bf{print('}}Value is less than 5{\bf{')}} \newline {\emph{n}} {\bf{+=}} 1 \#{\emph{Update}} \newline \newline \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# \newline \# {\bf{for}}: for count-controlled loops \& sequences of data \newline \# (with or without "range") \newline \newline {\bf{for}} {\emph{variable}} {\bf{in {[}}}{\emph{value1{\bf{}},}} {\emph{value2{\bf{}},}} {\emph{etc{\bf{}}{]}:}} \newline {\emph{Statements}} \newline \newline {\bf{for}} {\emph{variable}} {\bf{in range(}}{\emph{x{\bf{}},}} {\emph{y{\bf{}},}} {\emph{z{\bf{}}):}} \newline {\emph{Statements}} \#{\emph{Range: {\bf{x}}=start, {\bf{y}}=end, {\bf{z}}=step value}} \newline \newline \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# \newline \# {\bf{else}} clause: (optional) for loops that \newline \# contain a {\bf{break}} statement \newline \newline \# Else clause never executes because break does execute: \newline {\bf{for}} {\emph{n}} {\bf{in range(}}10{\bf{):}} \newline {\bf{if}} {\emph{n}} {\bf{==}} 5{\bf{:}} \newline {\bf{print('}}Breaking out of loop{\bf{')}} \newline {\bf{break}} \newline {\bf{print(}}{\emph{n{\bf{}})}} \newline {\bf{else:}} \newline {\bf{print(f'}}After the loop, n is \{{\emph{n}}\}.{\bf{')}} \newline \newline \# Else clause does execute because break never does: \newline {\bf{for}} {\emph{n}} {\bf{in range(}}3{\bf{):}} \newline {\bf{if}} {\emph{n}} {\bf{==}} 5{\bf{:}} \newline {\bf{print('}}Breaking out of loop{\bf{')}} \newline {\bf{break}} \newline {\bf{print(}}{\emph{n{\bf{}})}} \newline {\bf{else:}} \newline {\bf{print(f'}}After the loop, n is \{{\emph{n}}\}.{\bf{')}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Variables}} \tn % Row 0 \SetRowColor{LightBackground} Assign {\bf{and}} return variable's value:\{\{nl\}\}(walrus operator) & `{\bf{print(}}{\emph{variable}} {\bf{:=}} {\emph{value{\bf{}})}}` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Set variable from input: & `{\emph{variable}} {\bf{= input(}}{\emph{prompt{\bf{}})}}` \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} Set integer variable & `{\emph{variable}} {\bf{= int(}}{\emph{expression{\bf{}})}}` \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} Set float variable:\{\{nl\}\}(decimal number) & `{\emph{variable}} {\bf{= float(}}{\emph{expression{\bf{}})}}` \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} Set string variable from input: & `{\emph{variable}} {\bf{= str(input(}}{\emph{prompt{\bf{}}))}}` \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} Set Boolean variable:\{\{nl\}\}(true/false) & \{\{nobreak\}\}Single Line:\{\{nl\}\}`{\emph{variable}} {\bf{=}} {\emph{val1}} {\bf{if}} {\emph{condition}} {\bf{else}} {\emph{val2}}`\{\{nl\}\}Multiple Lines:\{\{nl\}\}`{\bf{if}} {\emph{condition{\bf{}}:}}`\{\{nl\}\}`\_ \_ {\emph{variable}} {\bf{=}} {\emph{val1}}`\{\{nl\}\}`{\bf{else}}`\{\{nl\}\}`\_ \_ {\emph{variable}} {\bf{=}} {\emph{val2}}`\{\{nl\}\} \tn % Row Count 26 (+ 12) % Row 6 \SetRowColor{LightBackground} String concatenation: & `{\bf{message = 'Hello ' + 'world'}}`\{\{nl\}\}`{\bf{print(message)}}`\{\{nl\}\}Output: `{\bf{Hello world}}` \tn % Row Count 31 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.08 cm} x{3.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Boolean Expressions}} \tn % Row 0 \SetRowColor{LightBackground} `{\emph{x}} {\bf{\textgreater{}}} {\emph{y}}` & {\emph{x}} is greater than {\emph{y}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\emph{x}} {\bf{\textless{}}} {\emph{y}}` & {\emph{x}} is less than {\emph{y}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\emph{x}} {\bf{\textgreater{}=}} {\emph{y}}` & {\emph{x}} is greater than or equal to {\emph{y}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `{\emph{x}} {\bf{\textless{}=}} {\emph{y}}` & {\emph{x}} is less than or equal to {\emph{y}} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\emph{x}} {\bf{==}} {\emph{y}}` & {\emph{x}} is equal to {\emph{y}} \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} `{\emph{x}} {\bf{!=}} {\emph{y}}` & {\emph{x}} is not equal to {\emph{y}} \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} `{[}{\emph{expression1}}{]} {\bf{and}} {[}{\emph{expression2}}{]}` & both expressions must be true \tn % Row Count 14 (+ 3) % Row 7 \SetRowColor{white} `{[}{\emph{expression1}}{]} {\bf{or}} {[}{\emph{expression2}}{]}` & at least one expression must be true \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} `{\bf{not}} {[}{\emph{expression}}{]}` & reverses value (false=true, true=false) \tn % Row Count 19 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Turtle Art!}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{{\emph{Command}}}} & {\bf{{\emph{What It Does}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `{\bf{import turtle}}` & Necessary at start of program \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\bf{turtle.done()}}` & Put at very end of program (keeps window from auto-closing) \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 6 (+ 0) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Colors \& Sizes -{}-{}-}}} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} `{\bf{turtle.setup(}}{\emph{width{\bf{}},}} {\emph{height{\bf{}})}}` & Set window size (in pixels) \tn % Row Count 10 (+ 3) % Row 6 \SetRowColor{LightBackground} `{\bf{turtle.bgcolor('}}{\emph{color{\bf{}}')}}` & Set window background color \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} `{\bf{turtle.pensize(}}{\emph{width{\bf{}})}}` & Set pen thickness (in pixels) \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} `{\bf{turtle.pencolor('}}{\emph{color{\bf{}}')}}` & Set pen color \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 16 (+ 0) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Turtle Management -{}-{}-}}} \tn % Row Count 17 (+ 1) % Row 11 \SetRowColor{white} `{\bf{turtle.penup()}}` & Raise pen (to move without drawing) \tn % Row Count 19 (+ 2) % Row 12 \SetRowColor{LightBackground} `{\bf{turtle.pendown()}}` & Lower pen (to resume drawing) \tn % Row Count 21 (+ 2) % Row 13 \SetRowColor{white} `{\bf{turtle.hideturtle()}}` & Hides turtle (does not affect drawing) \tn % Row Count 23 (+ 2) % Row 14 \SetRowColor{LightBackground} `{\bf{turtle.showturtle()}}` & Displays turtle \tn % Row Count 25 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 25 (+ 0) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Input via Dialog Box -{}-{}-}}} \tn % Row Count 26 (+ 1) % Row 17 \SetRowColor{white} \{\{nobreak\}\}`{\emph{var}} {\bf{= turtle.textinput ('}}{\emph{title{\bf{}}', '}}{\emph{prompt{\bf{}}')}}` & Assigns user's input to the variable as a string \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Turtle Art! (cont)}} \tn % Row 18 \SetRowColor{LightBackground} `{\emph{var}} {\bf{= turtle.numinput ('}}{\emph{title{\bf{}}', '}}{\emph{prompt{\bf{}}')}}` & Assigns user's input to the variable as a float \tn % Row Count 4 (+ 4) % Row 19 \SetRowColor{white} \{\{ar\}\}`{\emph{var}} {\bf{= turtle.numinput ('}}{\emph{t{\bf{}}', '}}{\emph{p{\bf{}}', default=}}{\emph{x{\bf{}},\{\{nl\}\} minval=}}{\emph{y{\bf{}}, maxval=}}{\emph{z{\bf{}})}}` & Optional arguments:\{\{nl\}\}{\bf{{\emph{x}}}} = default value displayed in input box\{\{nl\}\}{\bf{{\emph{y}}}} = reject any number less than {\emph{y}}\{\{nl\}\}{\bf{{\emph{z}}}} = reject any number greater than {\emph{z}} \tn % Row Count 13 (+ 9) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 13 (+ 0) % Row 21 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Movement \& Positioning -{}-{}-}}} \tn % Row Count 14 (+ 1) % Row 22 \SetRowColor{LightBackground} `{\bf{turtle.forward(}}{\emph{n{\bf{}})}}` & moves turtle {\emph{n}} distance in direction it's currently facing \tn % Row Count 17 (+ 3) % Row 23 \SetRowColor{white} `{\bf{turtle.setheading(}}{\emph{n{\bf{}})}}` & Set turtle's heading to a specific angle (90 is up) \tn % Row Count 20 (+ 3) % Row 24 \SetRowColor{LightBackground} `{\bf{turtle.right(}}{\emph{n{\bf{}})}}` & Turn {\emph{n}} degrees to the right \tn % Row Count 22 (+ 2) % Row 25 \SetRowColor{white} `{\bf{turtle.left(}}{\emph{n{\bf{}})}}` & Turn {\emph{n}} degrees to the left \tn % Row Count 24 (+ 2) % Row 26 \SetRowColor{LightBackground} `{\bf{turtle.goto(}}{\emph{x{\bf{}},}} {\emph{y{\bf{}})}}` & Move turtle to specific coordinates \tn % Row Count 26 (+ 2) % Row 27 \SetRowColor{white} `{\bf{turtle.pos()}}` & Displays turtle's current coordinates \tn % Row Count 28 (+ 2) % Row 28 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 28 (+ 0) % Row 29 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Drawing \& Writing -{}-{}-}}} \tn % Row Count 29 (+ 1) % Row 30 \SetRowColor{LightBackground} `{\bf{turtle.fillcolor('}}{\emph{color{\bf{}}')}}` & Set color for filling shape \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Turtle Art! (cont)}} \tn % Row 31 \SetRowColor{LightBackground} `{\bf{turtle.begin\_fill()}}` & Use before drawing shape to be filled \tn % Row Count 2 (+ 2) % Row 32 \SetRowColor{white} `{\bf{turtle.end\_fill()}}` & Use after shape has been drawn \tn % Row Count 4 (+ 2) % Row 33 \SetRowColor{LightBackground} `{\bf{turtle.circle(}}{\emph{radius{\bf{}})}}` & Draw a circle with specified radius \tn % Row Count 6 (+ 2) % Row 34 \SetRowColor{white} `{\bf{turtle.dot()}}` & Draw a simple dot at current location \tn % Row Count 8 (+ 2) % Row 35 \SetRowColor{LightBackground} `{\bf{turtle.write(}}{\emph{text{\bf{}})}}` & Writes text, with lower left corner of 1st character at turtle's coordinates \tn % Row Count 12 (+ 4) % Row 36 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 12 (+ 0) % Row 37 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{ac\}\}{\bf{-{}-{}- Erasing \& Undoing -{}-{}-}}} \tn % Row Count 13 (+ 1) % Row 38 \SetRowColor{white} `{\bf{turtle.clear()}}` & Erases all drawing, but {\bf{doesn't}} reset turtle position, pen color, or background color \tn % Row Count 18 (+ 5) % Row 39 \SetRowColor{LightBackground} `{\bf{turtle.reset()}}` & Clears/resets everything {\bf{except}} window background color \tn % Row Count 21 (+ 3) % Row 40 \SetRowColor{white} `{\bf{turtle.clearscreen()}}` & Clears/resets {\emph{everything}} \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}