TGViewer
Programming Resources | Python | Javascript | Artificial Intelligence Updates | Computer Science Courses | AI Books Programming Resources | Python | Javascript | Artificial Intelligence Updates | Computer Science Courses | AI Books @programming_guide ยท 56K subscribers
Post #3733 1.62K
Quick Python Cheat Sheet for Beginners ๐Ÿโœ๏ธ

Python is widely used for data analysis, automation, and AIโ€”perfect for beginners starting their coding journey.

Aggregation Functions ๐Ÿ“Š

โ€ข sum(list) โ†’ Adds all values
๐Ÿ‘‰ sum([1,2,3]) = 6
โ€ข len(list) โ†’ Counts total elements
๐Ÿ‘‰ len([1,2,3]) = 3
โ€ข max(list) โ†’ Highest value
๐Ÿ‘‰ max([4,7,2]) = 7
โ€ข min(list) โ†’ Lowest value
๐Ÿ‘‰ min([4,7,2]) = 2
โ€ข sum(list)/len(list) โ†’ Average
๐Ÿ‘‰ sum([10,20])/2 = 15

Lookup / Searching ๐Ÿ”

โ€ข in โ†’ Check existence
๐Ÿ‘‰ 5 in [1,2,5] = True
โ€ข list.index(value) โ†’ Position of value
๐Ÿ‘‰ [10,20,30].index(20) = 1
โ€ข Dictionary lookup
๐Ÿ‘‰ data = {"name": "John", "age": 25} data["name"] # John

Logical Operations ๐Ÿง 

โ€ข if condition: โ†’ Decision making
๐Ÿ‘‰ if x > 10: print("High") else: print("Low")
โ€ข and โ†’ All conditions true
โ€ข or โ†’ Any condition true
โ€ข not โ†’ Reverse condition

Text (String) Functions ๐Ÿ”ค

โ€ข len(text) โ†’ Length
๐Ÿ‘‰ len("hello") = 5
โ€ข text.lower() โ†’ Lowercase
โ€ข text.upper() โ†’ Uppercase
โ€ข text.strip() โ†’ Remove spaces
๐Ÿ‘‰ " hi ".strip() = "hi"
โ€ข text.replace(old, new)
๐Ÿ‘‰ "hi".replace("h","H") = "Hi"
โ€ข String concatenation
๐Ÿ‘‰ "Hello " + "World"

Date Time Functions ๐Ÿ“…

โ€ข from datetime import datetime
โ€ข datetime.now() โ†’ Current date time
โ€ข Extract values:
now = datetime.now() now.year now.month now.day

Math Functions โž—

โ€ข import math
โ€ข math.sqrt(x) โ†’ Square root
โ€ข math.ceil(x) โ†’ Round up
โ€ข math.floor(x) โ†’ Round down
โ€ข abs(x) โ†’ Absolute value

Conditional Aggregation (Like Excel SUMIF) โšก

โ€ข Using list comprehension

nums = [10, 20, 30, 40] sum(x for x in nums if x > 20) # 70

โ€ข Count condition

len([x for x in nums if x > 20]) # 2

Pro Tip for Data Analysts ๐Ÿ’ก

๐Ÿ‘‰ For real-world work, use libraries: pandas & numpy

Example:
import pandas as pd df["salary"].mean()

Python Resources: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L

Double Tap โ™ฅ๏ธ For More
  • ๐Ÿ‘ 8
  • โค 3
More from @programming_guide
  1. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  2. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  3. Sep 29, 2026๐Ÿง  Core Programming Concepts You Should Know ๐Ÿ’ป๐Ÿš€ These are the fundamental ideas behind aโ€ฆ
  4. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
  5. Sep 28, 2026YOU SHOULD WRITE CODE ON PAPER ๐Ÿ“œIF U R BEGINNER ... HERE IS WHY ๐Ÿค” If you're a beginner lโ€ฆ
  6. Sep 28, 2026๐ŸŽ“ ๐—›๐—”๐—ฅ๐—ฉ๐—”๐—ฅ๐—— ๐—จ๐—ก๐—œ๐—ฉ๐—˜๐—ฅ๐—ฆ๐—œ๐—ง๐—ฌ ๐—™๐—ฅ๐—˜๐—˜ ๐—ข๐—ก๐—Ÿ๐—œ๐—ก๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐Ÿ˜ Dreaming ofโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’