0% found this document useful (0 votes)
2 views1 page

Python Beginner Cheat Sheet A4 Two Column

This document is a Python Beginner Cheat Sheet that covers essential programming concepts such as symbols, variables, types, operators, strings, input/output, loops, lists, dictionaries, functions, imports, and comments. Each section provides examples and basic syntax for beginners to understand and utilize Python effectively. It serves as a quick reference guide for fundamental Python programming elements.

Uploaded by

xguess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Beginner Cheat Sheet A4 Two Column

This document is a Python Beginner Cheat Sheet that covers essential programming concepts such as symbols, variables, types, operators, strings, input/output, loops, lists, dictionaries, functions, imports, and comments. Each section provides examples and basic syntax for beginners to understand and utilize Python effectively. It serves as a quick reference guide for fundamental Python programming elements.

Uploaded by

xguess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Beginner Cheat Sheet

1. SYMBOLS 7. LOOPS
# Comment for i in range(3):
() Parentheses print(i)
[] Lists
{} Dictionaries count = 0
: Colon while count < 3:
; Semicolon print(count)
, Comma count += 1
'' String quotes 8. LISTS
\n New line fruits = ['apple']
\t Tab fruits.append('orange')
2. VARIABLES & TYPES print(fruits[0])
x = 5 # int 'apple' in fruits
y = 3.14 # float len(fruits)
name = 'Anna' # str 9. DICTIONARIES
is_happy = True # bool person = {'name': 'Tom'}
type(x) # check type print(person['name'])
3. OPERATORS person['age'] = 25
+ - * / # math 10. FUNCTIONS
% ** // # mod, power, floor def greet(name):
== != > < >= <= # compare print('Hi', name)
and or not # logic greet('Anna')
+= -= *= /= # assign 11. IMPORTS
4. STRINGS import math
s = 'Hello' math.sqrt(16)
s.upper() # 'HELLO'
s[0] # 'H' import random
'lo' in s # True random.randint(1, 5)
len(s) # 5 12. COMMENTS
5. INPUT / OUTPUT # single line
name = input('Name: ') '''multi-line comment'''
print('Hi', name)
6. IF / ELSE
if age >= 18:
print('Adult')
elif age > 12:
print('Teen')
else:
print('Child')

You might also like