Automatically translated.View original post

🚀 Summary of Data Types in Python to Know!

This is a very important data type in Python! Knowing how each data type is stored and how it works is the heart of writing code!

📊 Key Data Types:

• Text Type: str (String) - Used for text

• Numeric Types: int (integer), float (decimal), complex (complex number)

• Sequence Types: list (changeable), tuple (unchangeable), range

• Mapping Type: Dictionary - Key-Value Storage

• Set Types: set (unique / unsorted), frozenset (incorrigible set)

• Boolean Type: bool - True or False

• None Type: NoneType - Use to replace empty value without value

💡 Techniques used in code:

We can use the type () function to determine what the variable we define always has a data type! Let's take a sample of the code and review it.

"Know Data Type like you know the data. The code will work effectively!"

# python # Programming # data # Data analytics # learnonlemon8

2025/10/30 Edited to

... Read moreเมื่อพูดถึงชนิดข้อมูลใน Python การเข้าใจกฎการตั้งชื่อตัวแปรก็เป็นสิ่งสำคัญไม่แพ้กันค่ะ โดยตัวแปรจะต้องเริ่มต้นด้วยตัวอักษร (a-z, A-Z) หรือเครื่องหมายขีดล่าง (_) และห้ามขึ้นต้นด้วยตัวเลข รวมถึงไม่ควรใช้คำสงวนของภาษา Python เช่น "None" หรือ "True" เป็นชื่อตัวแปร เพราะจะทำให้เกิดความสับสนในโค้ด ในส่วนของ NoneType ที่เป็นชนิดข้อมูลพิเศษ ใช้เพื่อแทนค่าที่ไม่มีค่า (null) เช่น ตัวแปรที่ยังไม่ได้รับค่า หรือใช้ในกรณีที่ฟังก์ชันไม่มีการคืนค่ากลับ ซึ่งทำให้โค้ดมีความชัดเจนและป้องกันข้อผิดพลาดได้ดี นอกจากชนิดข้อมูลหลักที่กล่าวถึงแล้ว ใน Python ยังมีชนิดข้อมูล Binary เช่น bytes, bytearray, และ memoryview ที่เหมาะกับการจัดการข้อมูลไบนารีหรือข้อความที่อยู่ในรูปแบบบิตระดับต่ำ เช่น การจัดการไฟล์หรือการสื่อสารกับฮาร์ดแวร์ การรู้ชนิดข้อมูลของตัวแปรช่วยให้เราเขียนโค้ดที่ถูกต้องและมีประสิทธิภาพมากขึ้น นอกจากนั้นยังทำให้การดีบั๊กและพัฒนาโปรแกรมเป็นไปอย่างราบรื่น หากคุณเป็นมือใหม่ แนะนำให้ลองเขียนโค้ดตัวอย่างและใช้ฟังก์ชัน type() เพื่อตรวจสอบชนิดของตัวแปรบ่อย ๆ จะช่วยให้เข้าใจและคุ้นเคยกับชนิดข้อมูลต่าง ๆ ใน Python มากขึ้นค่ะ

Related posts

Impressive LinkedIn Summary for Data Analyst
Hello everyone! I wanted to share tips for creating an impressive LinkedIn summary for data analysts. Start by clearly stating your role and years of experience. Highlight core skills, such as Python, SQL, and Tableau, along with your key achievements and industry expertise. Express your passion fo
Yun Jung

Yun Jung

49 likes

A person wearing headphones sits at a desk with a computer displaying a graph, a plant, and a glowing yellow lamp. The image has text overlay 'Learn Python in 50 DAYS' and 'lemon8 @compskyy'.
A blurred background of a laptop with text overlay outlining the Python learning schedule for Day 1-20, covering programming basics, operations, strings, variables, and control structures.
A blurred background of a desk with a computer screen, featuring text overlay detailing the Python learning schedule for Day 21-40, including functions, modules, exceptions, files, and functional programming.
Learn Python in 50 Days!!
🐍If you want to learn how to code and you don't know what programming language to start with, then I would highly recommend Python! It's a super popular language in the industry and you can do so much with it. It is very beginner friendly compared to most languages and the fields you could
CompSkyy

CompSkyy

600 likes

Why analysts should use Python for Data Processing
Hello Data Analysts! I wanted to highlight Python's efficiency in data cleaning and preprocessing. Python libraries like Pandas and NumPy offer methods to handle missing data, transform data types, and encode categorical variables like one-hot encoding. Tools such as drop_duplicates() ensure da
Yun Jung

Yun Jung

43 likes

A study desk with an iPad, highlighter, textbook, and notes, featuring the title "How to get a 4.00 GPA Based on your Major" and "All majors included!".
Strategies for Business & Management Majors (Business Management, Accounting, Finance, Economics), including Active Participation, Case Study Analysis, Practice Financial Modeling, and Utilize Study Groups, with mentions of MarketingSherpa and GroupMe.
Strategies for Communications & Education Majors (Communications, Education), including Create Multimedia Presentations, Peer Teaching, Reflective Journaling, and Attend Workshops, with mentions of Canva and Notion.
Major-Specific Strategies to Achieve a ✨4.0 GPA✨🎓🧠
🎓1. Business & Management Majors (Business Management, Accounting, Finance, Economics) ✅Active Participation: Example: In a Marketing class, when discussing a case study like Coca-Cola’s rebranding, share your analysis of the marketing mix (4Ps). This not only engages you in the materi
Chalie_Baker

Chalie_Baker

7060 likes

The image displays a planner and a tablet on a dark grey fabric, with the title "6 Free ONLINE STUDY Resources For STUDENTS" overlaid, introducing online study tools.
A yellow plush toy with a smiley face rests on a dark grey fabric, accompanying text about LifeHack offering online resources for students of all ages to enhance learning.
A hand holds an Essentia water bottle on a dark grey fabric, with text explaining OpenStax provides free, peer-reviewed online textbooks for K-12 students across various subjects.
6 Free Online Study Resources For Students ✨️
Hi, lemons! Whether you’re rocking the high school vibes or acing college life, let’s talk about some free online resources that’ll light up your learning journey. 🚀 In this post, you can explore my curated list of free online resources that cater to various learning needs. From interactive cou
Lifestyle Babe

Lifestyle Babe

685 likes

A student studies at a desk with a computer, books, and plants, with text overlay 'Study Timetables 4 student types' and 'STUDYWITHEMMANE'.
A pink grid background displays a study timetable for 'Lazy students', detailing low-effort, low-friction productivity tasks like YouTube summaries, writing, and gentle review, totaling about 1.5 hours daily.
A pink grid background displays a study timetable for 'ADHD students', detailing short, varied bursts of deep work using Pomodoro techniques for reading, writing, listening, and active recall, totaling 2 hours daily.
Study timetables for 4 student types
#study #studytips #studying #studyschedule
studywithemmane

studywithemmane

476 likes

Types of note taking styles
Here are five types of note-taking methods and their benefits: 1. Outline Method: This method organizes information hierarchically, making it easy to see the main ideas and supporting details. It's great for capturing structured content like lectures or textbooks, as it helps in summarizing
essynotes

essynotes

1204 likes

A handwritten study sheet titled 'Steal my nervous system Review Sheets' detailing neuroglial cells of the CNS (Ependymal, Oligodendrocytes, Astrocytes, Microglial) and the definition of Action Potential, including polarization and resting potential.
A handwritten study sheet outlining the '4 Steps of Action Potential': Resting Potential (maintained by Sodium Potassium Pump), Depolarization, Repolarization, and Hyperpolarization, with explanations for each stage.
A handwritten study sheet defining 'Neurons' (nerve cells, their parts, and unusual characteristics), 'Cell Body,' 'Dendrites,' 'Axon,' and 'Synapse,' explaining neurotransmitter release and transmission.
Steal my nervous system a&p summary sheets 🗒️
Master the Nervous System! 🧠✨ Sharing my AP 2 notes to make studying easier—save this for future reference! 📌 Hope someone benefits from all these notes haha, my hand almost fell off writing them all out! The nervous system is one of the most complex and important systems in the body, controlli
Stella Studies

Stella Studies

175 likes

A person sits on a bed, using a tablet, with text overlaying the image that reads "Summer Study Timetables for 4 Student Types" and "Swipe".
A study timetable for a "lazy student" outlining a low-effort, consistent schedule with tasks like watching YouTube summaries, short writing, and gentle review, totaling about 1.5 hours daily.
A study timetable for an "ADHD student" featuring short, varied bursts of deep work, including timed reading, writing, listening, and active recall, totaling 2 hours daily.
Maximize Your Study Timetable (4 Student Types)
1. The Lazy Student 😴 If motivation is low, don’t force long hours—use tiny, low-pressure wins. Start around 10:00 a.m. with something light like watching a video or reading casually. Do one Pomodoro (25 mins) at 3:00 p.m.—maybe quiz yourself or summarize a page. Around 8:00 p.m., listen to notes
emilie.studygram

emilie.studygram

61 likes

A title slide displaying 'TYPES of DIGITAL PRODUCTS YOU CAN SELL' with 'Total sales $6.42k, 257 orders' and decorative pink hearts and stars, set against a blurred outdoor background.
A white slide defining 'EBOOKS' as digital books readable on electronic devices, with examples including self-help guides, novels, and cookbooks.
A white slide defining 'ONLINE COURSES' as educational programs delivered via the internet, with examples like digital marketing, coding, and photography courses.
Types of digital products you can sell
Digital products are intangible assets that can be sold and distributed online, offering a wide range of opportunities for generating passive income. By exploring these various types of digital products, you can identify the best fit for your skills and interests. Each type offers unique opportu
Tia_Antoinette

Tia_Antoinette

166 likes

A woman with curly hair holds a microphone, presenting a title card that reads 'Data Analysis with Python For Beginners'.
A woman with curly hair holds a microphone, presenting an introductory text about simple steps for learning Python for Data Analysis.
A woman with curly hair holds a microphone, presenting a list of four steps for beginners to learn Python for Data Analysis.
Beginner Friendly Tips For Learning Python for Dat
If I was to learn Python for Data Analysis as a beginner, I would start with the basics, I would learn: Variables Data Types Loops and Functions. There's no Python without libraries and these are the most used for Data Analysis: 👉 Pandas - Data Manipulation 👉 Numpy - Numerical Comput
NeLo

NeLo

77 likes

Summary of Our Trip to Chattanooga!
We had a short road trip to Chatnooga and here are some random pictures from it! 🎄 We saw reindeer! 🎄 Scooters , Sugar Cookie Latte ! I want a whole kitchen full of them ! 🤤🤤 ⛄️What did y’all do Thanksgiving? #wintertimevibes #travelwithme2024 #letschat #lemon8challenge #chat
👑💜

👑💜

10 likes

💻Try Linear Regression Modeling in Python
Since we’ve covered basic concepts like mean, median, correlation and linear regression, it is time we practiced using Python. Please refer to the pictures in this post for detailed coding and data display. 🖋️Get data set from Kaggle I downloaded the Titanic data set from the famous data scie
Capital&Crypto

Capital&Crypto

13 likes

STEELER DRAFT SUMMARY PT 2
The 2026 draft has come to an end here in Pittsburgh and overall I am very satisfied with Coach Mike McCarthy's first draft as the Pittsburgh Steelers head coach! I think they addressed all the major needs and added some real talent that will spark this Pittsburgh Steeler team. Follow, subscrib
A Pittsburgh basement

A Pittsburgh basement

1 like

A spiritual guide detailing the Mars, Root Chakra, and Fire Element energy summary. It explains their connection to drive, stability, and survival, outlining effects of balanced and imbalanced energy, and suggesting healing practices like grounding and affirmations for building strength and confidence.
Root ,Mars ,and Fire element energy summary 🔥
Goddess E

Goddess E

6 likes

Exodus Chapter Summary & Prayer 🙏🏾
#seekhim✝️ #thankyoulordforeverything😇🙏 #biblestudywithme #exodus #journaling
My Purpose 🌸

My Purpose 🌸

10 likes

The image displays the title 'What to learn: Excel for Data Analysis Roadmap' in green text with a bar chart icon, set against a white background with faint horizontal lines. 'Lemon8' watermarks are visible at the bottom.
What to learn : Excel for Data Analysis Roadmap📊
What to learn first Interface basics: workbook vs. worksheet, rows, columns, cell references, absolute vs. relative ($A$1 vs. A1) Cleaning data: Text to Columns, Remove Duplicates, TRIM, CLEAN, PROPER, find/replace, Data Validation Core formulas: SUMIFS, AVERAGEIFS, COUNTIFS, IF, IFS, AND, OR, X
Jenney🫶🏽🤭

Jenney🫶🏽🤭

3 likes

Summary of my writing and reading🤍
Summary of last week of my writing and reading! It’s starting to get busy with birthday celebrations but I am hoping to read more this week and write more. I am feeling under the weather so giving myself some rest and ready to hit my goals as soon as I feel better! Still I’d say a pretty good week🤩
shaleyauthor

shaleyauthor

11 likes

Summary of days 1 to 11 of the free food pantry
Summary of days 1 to 11 of the free food pantry project (Part 25) #foodbank #foodpantry #dealfindershops #community #lifestyle
DealFinderShops

DealFinderShops

5 likes

Steal my MicroBiology Reaction Summary Pages 📄✨
Master Microbio with These Must-Know Metabolic Pathways! Struggling with microbiology? I’ll be honest—learning photosynthesis, redox reactions, the Krebs cycle, and glycolysis nearly melted my brain at first. There were so many steps, enzymes, and cycles that it felt impossible to keep everythin
Stella Studies

Stella Studies

33 likes

An open Bible or devotional book with the overlaid title "Study the Bible with me! My Summary Chapters of Mark." Handwritten notes below summarize Chapter 1: "They left everything they knew & followed Jesus." The pages display biblical text and a section on "A Purpose-full Friendship." The bottom left corner shows "lemon8" and the username.
My Summary Chapters of ✨ Mark ✨
I’m back with another Bible Chapter summary and what stood out to me! Here’s my key takeaways! ✨ Chapter 1: (highlighted verses 17-20) The First Disciples! They IMMEDIATELY left everything they knew & followed Jesus. They left family and etc to follow Jesus! Help me to step out of what seem
NicoleJRice

NicoleJRice

43 likes

A weekly horoscope for July 8-14, stating that sleep has been improving and things are getting better, with 'Astro Lobotomy' at the bottom.
A weekly horoscope for July 8-14, explaining that Venus moving into a fire sign will counteract negative water energy, improving emotional well-being and health issues.
A horoscope for July 8-14, detailing how Venus in a fire sign affects self-indulgence, romantic relationships, online dating, and is beneficial for those hoping to become parents.
Horoscope summary 7/8-7/14 (part 1)
Follow so you don’t miss anything 🧠🧠 New uploads every day, if you don’t see your sign, come back tomorrow! July 8-14, 2024 horoscope summary #astrolobotomy #zodiac #horoscope
The Kevin

The Kevin

1 like

See more