Docsity

Algorithms Cheat Sheet, Study notes of Algorithms and Programming

Partial preview of the text

Download Algorithms Cheat Sheet and more Study notes Algorithms and Programming in PDF only on Docsity!

Flowchart Conventions

Name Symbol Usage

Start or Stop/End Signifies the start or end of a sequence. Process An instruction. Input/Output Data received or sent by a computer. Decision A condition which is either true or false. Subroutines Calls a subroutine Direction of Flow Connects the symbols.

Python Syntax

Action Python code

Assign a variable myVariable^ =^42 myOtherVariable = “Hello” Print something print(“This^ will^ be^ printed”) Getting input age^ =^ input(“How^ old^ are^ you?”) if/else if^ age^ >^ 17: print(“You are an adult”) else: print(“You are not an adult yet”) for loop for^ i^ in^ range(0,10): print(i) while loop while(True): print(“hello again”)