Python CHEAT sheet

👇🧵 Highlights and download

1. Base Types

For calculations
✔️ int + float

For program flow
✔️ bool

For text and data
✔️ str + bytes

👇🧵
2. Data Structures

Most common
✔️ list + dict

Common indirect use
✔️ tuple

👇🧵
3. Variable Assignment

Highlights
✔️ a = b = c = 0 # same value
✔️ a, b = b, c # swap values

👇🧵
4. Conversions

Trick:
"one two three" -> "one-two-three"
👇
'-'.join("one two three".split())

👇🧵
5. Conditional Statement

Check if in list:
if item in ['foo', 'bar']:
# item is foo or bar
else:
# item not foo or bar

👇🧵
6. Boolean Logic

Priority is NOT, then AND, then OR

Example:
True or False and False -> TRUE

👇🧵
7. Display and Input

f-string example

name = Python
age = 2023 - 1991
print(f'{name} is {age} years old')

👇🧵
The full cheat sheet includes
✔️ loops
✔️ files
✔️ sequences
✔️ list + dict operations
✔️ string operations
...and much more

https://t.co/8HH5vMpBSy

More from Learn Python With Rune

Want to learn Django?

Check out these 8 free resources.

see 👇🧵

Get started with Django

Covers
- Installing and creating first project
- Working with templates
- Authentication frameworks
...and much more

More resources

Django Admin Cookbook

How to do things with Django admin
- Create two admin sites
- Bulk and custom actions
- Working with permissions
...and much more

https://t.co/NM0Nby5NwB

More 👇🧵


Django ORM cookbook

How to do things using Django ORM
- How to do OR/AND queries in ORM
- CRUD with ORM
- Database modelling
...and much more

https://t.co/tYjdbiYpWU

More 👇🧵


Building APIs with Django and Django Rest Framework

Learn about
- Simple API with pure Django
- Serializing and Deserializing data
- Access control
...and much more

https://t.co/gQTDxiG3wX

More 👇🧵
Top 10 Data Science Projects with Python

✔️ 10 Datasets
✔️ 10 Projects with solution

👇🧵

1️⃣ Project: Detecting Spam

✔️ Big email dataset
✔️ 35.000+ spam and ham messages
✔️ Learn how to filter

https://t.co/wvNSeFSbmr

Solution 👇🧵

1️⃣ Solution: Detecting Spam

✔️ How to build a spam filter
✔️ Using Scikit-learn
✔️ Naive-Bayes and

2️⃣ Project: Music Recommendation

✔️ Million Song Dataset
✔️ Metadata for a million songs

https://t.co/QgdSdIYnVV

Solution 👇🧵

2️⃣ Solution: Music Recommendation

✔️ Using Tableau
✔️ Collaborative-filtering engine
✔️ Similar to YouTube

More from All

🌺श्री गरुड़ पुराण - संक्षिप्त वर्णन🌺

हिन्दु धर्म के 18 पुराणों में से एक गरुड़ पुराण का हिन्दु धर्म में बड़ा महत्व है। गरुड़ पुराण में मृत्यु के बाद सद्गती की व्याख्या मिलती है। इस पुराण के अधिष्ठातृ देव भगवान विष्णु हैं, इसलिए ये वैष्णव पुराण है।


गरुड़ पुराण के अनुसार हमारे कर्मों का फल हमें हमारे जीवन-काल में तो मिलता ही है परंतु मृत्यु के बाद भी अच्छे बुरे कार्यों का उनके अनुसार फल मिलता है। इस कारण इस पुराण में निहित ज्ञान को प्राप्त करने के लिए घर के किसी सदस्य की मृत्यु के बाद का समय निर्धारित किया गया है...

..ताकि उस समय हम जीवन-मरण से जुड़े सभी सत्य जान सकें और मृत्यु के कारण बिछडने वाले सदस्य का दुख कम हो सके।
गरुड़ पुराण में विष्णु की भक्ति व अवतारों का विस्तार से उसी प्रकार वर्णन मिलता है जिस प्रकार भगवत पुराण में।आरम्भ में मनु से सृष्टि की उत्पत्ति,ध्रुव चरित्र की कथा मिलती है।


तदुपरांत सुर्य व चंद्र ग्रहों के मंत्र, शिव-पार्वती मंत्र,इन्द्र सम्बंधित मंत्र,सरस्वती मंत्र और नौ शक्तियों के बारे में विस्तार से बताया गया है।
इस पुराण में उन्नीस हज़ार श्लोक बताए जाते हैं और इसे दो भागों में कहा जाता है।
प्रथम भाग में विष्णुभक्ति और पूजा विधियों का उल्लेख है।

मृत्यु के उपरांत गरुड़ पुराण के श्रवण का प्रावधान है ।
पुराण के द्वितीय भाग में 'प्रेतकल्प' का विस्तार से वर्णन और नरकों में जीव के पड़ने का वृत्तांत मिलता है। मरने के बाद मनुष्य की क्या गति होती है, उसका किस प्रकार की योनियों में जन्म होता है, प्रेत योनि से मुक्ति के उपाय...

You May Also Like

1

From today, we will memorize the names of 27 Nakshatras in Vedic Jyotish to never forget in life.

I will write 4 names. Repeat them in SAME sequence twice in morning, noon, evening. Each day, revise new names + recall all previously learnt names.

Pls RT if you are in.

2

Today's Nakshatras are:-

1. Ashwini - अश्विनी

2. Bharani - भरणी

3. Krittika - कृत्तिका

4. Rohini - रोहिणी

Ashwini - अश्विनी is the FIRST Nakshatra.

Repeat these names TWICE now, tomorrow morning, noon and evening. Like this tweet if you have revised 8 times as told.

3

Today's Nakshatras are:-

5. Mrigashira - मृगशिरा

6. Ardra - आर्द्रा

7. Punarvasu - पुनर्वसु

8. Pushya - पुष्य

First recall previously learnt Nakshatras twice. Then recite these TWICE now, tomorrow morning, noon & evening in SAME order. Like this tweet only after doing so.

4

Today's Nakshatras are:-

9. Ashlesha - अश्लेषा

10. Magha - मघा

11. Purvaphalguni - पूर्वाफाल्गुनी

12. Uttaraphalguni - उत्तराफाल्गुनी

Purva means that comes before (P se Purva, P se pehele), and Uttara comes later.

Read next tweet too.

5

Purva, Uttara prefixes come in other Nakshatras too. Purva= pehele wala. Remember.

First recall previously learnt 8 Nakshatras twice. Then recite those in Tweet #4 TWICE now, tomorrow morning, noon & evening in SAME order. Like this tweet if you have read Tweets #4 & 5, both.