Tag: python

  • Learn python this summer Day 9: Lists and List Comprehensions

    Learn python this summer Day 9: Lists and List Comprehensions

    Welcome back! Yesterday, we learned about working with files in Python. Today, we’ll dive into lists and list comprehensions, which are powerful tools for working with collections of data. By the end of this day, you’ll know how to create, manipulate, and use lists efficiently. Let’s get started! What are…

  • Learn python this summer Day 8: Working with Files

    Learn python this summer Day 8: Working with Files

    Welcome back! Yesterday, we learned about modules and packages in Python. Today, we’ll dive into working with files, which is essential for reading from and writing to files in your programs. By the end of this day, you’ll know how to handle files in Python. Let’s get started! Reading Files…

  • Learn Python This Summer: Day 2 Basic Syntax and Variables

    Learn Python This Summer: Day 2 Basic Syntax and Variables

    Welcome back! Yesterday, we got started with Python by setting up our environment and writing our first program. Today, we’ll dive into the basic syntax and learn about variables. By the end of this day, you’ll be able to write simple Python programs that use variables to store and manipulate…

  • Code Interview: Understanding Shallow Copy vs Deep Copy in Programming

    Code Interview: Understanding Shallow Copy vs Deep Copy in Programming

    Shallow Copy A shallow copy creates a new object, but inserts references into it to the objects found in the original. Changes made to a shallow copy of an object can reflect in the original object if the changes are made to a mutable object contained within the shallow copy.…

  • Understanding Python’s Built-in Data Types: Lists, Tuples, Sets, and Dictionaries Explained

    Understanding Python’s Built-in Data Types: Lists, Tuples, Sets, and Dictionaries Explained

    内置类型 Python 标准类型文档 存储数据集合 Set 是 Python 中用于存储数据集合的四种内置数据类型之一,另外三种是 List(列表)、Tuple(元组)和 Dictionary(字典),每种类型都有不同的特性和用途。 A set is an unordered, unchangeable*, and unindexed collection. 集合是一个无序的、不可变的*、无索引的集合。 *Note: While set items are unchangeable, you can remove items and add new items. *注意:虽然集合项是不可变的,但你可以删除项或添加新项。 Comparison of Python Collections Here’s a comparison table showing the main differences between List, Tuple,…

  • Learn Python This Summer: A 20-Day Plan for Kids

    Learn Python This Summer: A 20-Day Plan for Kids

    Hello! I’m Andrew, a 14-year-old with a passion for coding. This summer, I’m diving into Python, and I want you to join me on this exciting journey. As I learn, I’ll be sharing my progress and tips, so you can follow along and learn too. Get ready for our 20-day…

  • Comparison: List (list) vs Array (array)

    Comparison: List (list) vs Array (array)

    Comparison: List (list) vs Array (array) Here’s a detailed comparison between Python’s list and array from the array module. Comparison Table 比较表 Feature List (list) Array (array) Definition Built-in mutable sequence Module-based sequence for storing homogeneous data 定义 内置的可变序列 基于模块的同质数据存储序列 Import Required No Yes (from array import array) 需要导入 否…