My Python Programming Journey in 2020 Summer Vacation

Approx. 800 words, 4 mins.

  Table of Contents

Several days ago, my Python programming journey in 2020 summer vacation is arrived at the terminal, in which I have learned a lot about programming.

I listen and take notes carefully and consciously during the class and review them after school to make sure I don’t forget any important knowledge points.

After that, I am going to study English to prepare for an IELTS exam.

Do you know what happened during my Python programming journey? Follow me!


The Programming Journey

There are 5 days in my Python programming journey.

During The journey, I learned a lot about Python programming language. Some tasks were quite difficult such as calculations, but I still kept trying so I never fail on any programming tasks.

However, some classmates usually play games during the class, using their phones, their laptops, and the computers provided by the school. So, teachers were going to make some strict rules, letting the students hand in their phones before the lesson.

We make projects as we learn. Our project is called: The Flappy Bird (飞扬的小鸟), which contains the fundamental elements of Python.

Lessons in each day has been separated by 3 parts, in which we review the knowledge we learned in the last part and learn different new knowledge. After that, we continue to complete our project using the new knowledge we learned during this lesson.


What did I Learn?

I learned some basic knowledge of Python.

Import Modules

import easygui as eg # Make a variable 
import pygame
import random

Python Game Module

# Import the module
import pygame
# Initialize
pygame.init()
# Add a screen
screen = pygame.display.set_mode((width, height)) # There are 2 brackets
# Set title
pygame.display.set_caption('This is the title')

# Image
# Load image
# convert_alpha() means that the transparent part will be removed.
img1 = pygame.image.load('./images/img1.png').convert_alpha()
# Put image onto the screen
screen.blit(img1, (x, y))

# Text
# Set font
Font = pygame.font.SysFont('Arial', 20) # Arial, 20px
# Render text
# (text, erase border, background, foreground)
text = Font.render('This is the text.', True, (R, G, B), (R, G, B))
# Write text
screen.blit(text, (x, y))

# Audio
# Load audio file ('Sound' is captialized)
music1 = pygame.mixer.Sound('./audios/music1.mp3')
# Play audio
music1.play()

Random Number

# Import module
import random
# Random Number
x = random.random()
# 0 <= x < 1
print(x)
# Random integer
# Example: from 1 to 13
y = random.randint(1, 13)
print(y)

Easy GUI

# Import module (I set it to 'eg' so I can use it conveniently)
import easygui as eg
# Message (msg) Box
eg.msgbox('This is a message.', 'Title')
# Choice Box
choice1 = eg.choicebox('Choose ...', 'Title', ['A', 'B', 'C', 'D'])
# Enter Box
input1 = eg.enterbox('Please enter ...', 'Title')
# Yes/No Box
yn1 = eg.ynbox('Message.', 'Title')

# Example
eg.msgbox('Hello, Python! Nice to see you.', 'Hello Python!')
choice1 = eg.choicebox('What are you going to do today?', 'Things you do', ['A. Do your homework.', 'B. Go outside and relax.', 'C. Stay at home and do your things.', 'D. Chat with your friends', 'E. None of the above.'])
input1 = eg.enterbox('How are you today?', 'Understand your Feelings')
yn1 = eg.ynbox('Can I help you?', 'Question')

Logic

# While
while True:
    study()
# For and If - else if (elif) - else
for i in range(0, 100):
    if i % 3 == 0:
        print(str(i) + ': The number can be divided by 3.')
    # 'elif' is shorted by 'else if' in Python.
    elif i % 5 == 0:
        print(str(i) + ': The number can be divided by 5, but not 3.')
    else:
        print(str(i) + ': The number cannot be divided by 3 and 5.')

Storage

# Variable (name = value)
a = 3
b = 5
# Lists and Tuples start with [0]
# List (Array)
list1 = ['A', 'B', 1, 2, 3]
print(list1[0]) # A
# Tuple (cannot be edited once created)
tuple1 = ('C', 'D', 'E', 9, 8)
print(tuple1[3]) # 9
# Dictionary
JSON1 = {
    'name': 'Python',
    'role': 'Programming Language',
    'version': 3.7,
}
print(The version of str(JSON1['name']) + ' is ' + str(JSON1['version']))

Why we Learn Python?

Recently, there was a course upgrade in our programming class Tongcheng Tongmei (TCTM). All students need to learn Python after the upgrade.

Our lesson had been suspended for a few weeks due to the class modification when the course was upgraded.

We are now living in the 21st century, which is an information explosion society. AI (artificial intelligence) becomes a popular topic around the world, which develops the world at a fast speed and makes our life convenient.

In addition, artificial intelligence and other high-tech things need to be programmed. Without programming, the whole world could have been developed.

Programming is not easy! It requires strong logical brains and thinking skills. Programmers need to be very careful while they are programming. Otherwise, it will cause some security problems or bugs. Meanwhile, programming requires some programming languages, which contains English words and normal people are difficult to understand.

I am good at mathematics, English, and computer, so I have adequate abilities to write codes and make useful apps. Also, I am always careful, so my apps seldom have bugs. However, my programming teachers often produce bugs easily because of the careless.


Taking Notes

I always listen carefully and take notes during the class, so my scores are usually better than others.

However, taking notes in my notebook is a difficult task in the programming lesson because the space is small, which is used for the keyboard, mouse, and the computer. So, I take notes on the computer while I am programming, then I save them to my USB drive and take to my home.

Furthermore, notebooks on the computer are saved as .txt files, so I can send them onto my phone and review them on the subway to my home after school.

Not only do my notes in my school are excellent, but the notes during my Python programming lesson also have an excellent format. I separated my notes by 5 parts that are: Title and date, key words, knowledge point(s), cautions, codes.

When the journey ends, my notes have been shared by my teacher, which is posted on his WeChat Moment.

Some of my Notes


Being Featured by the School

I have been featured by my programming class on Oct. 24, 2019 because I am very good while I am having programming lessons.

I always listen carefully during the class and usually raise my hand to answer questions. When other classmates have programming problems, I am going to help them to solve. I always get a high score for the exams, even full marks. Also, I finish and hand in my programming homework on time.


Learning Programming in Other Places

I have learned Python for a little bit in another place during my United Kingdom summer camp last year, so I can learn it easily in the future.

I have made a game with Minecraft and Python during the lesson, stimulating my programming interest.


This is an article about my Python study journey in 2020 summer vacation. I hope I can make better apps using my programming knowledge.

Alright! This is the end of the article. Thanks for reading.

If you like this post, please click the thumb up button below and share this article. Also, you can write down your comment below if you have any ideas.

Still have questions or cannot understand my articles? Don't be hestiant to contact me and I am here to help you. I speak English and Chinese.

Reference Materials (No Copy and Paste)

Reference articles of this article are shown for obeying Academic Honesty rules

  Academic Honesty Policy

Learning Python and Minecraft in the United Kingdom / Published on Ken Deng / By: Ken Deng / Aug. 11th, 2019

Related Posts
8 Things that can Let me Study Effectively
Vocabulary Cards 2nd Generation Single

Many schools ban electronic devices to ensure student's safety. However, we still can use some non-electronic things to let me Read More

The First Several Weeks in Senior High School
GCGS Senior High School Sign 1

The first several weeks in my senior high school life was over, I have gained knowledge, made some new friends, Read More

Going to Senior High School and Start a New Study Journey
Going to Senior High School Countdown Clock

In a blink of eyes, the summer vacation is coming to the end. I will go to senior high school Read More

Leave a Reply

Your email address will not be published. Required fields are marked *