New school | 新学校

Elon Musk has a school for his children, Ad Astra (Latin: to the stars). That’s a great name for a school.

There are many things our schools could have done much better even though there are lots of constraints: the need to satisfy a very diverse population, and legal matters.
In American public schools, value lessons are largely missing. Many teachers do not check or grade homework.  Kids are getting more undisciplined as they grow older…Chinese language is not taught even though China is such an important country… programming is not taught…美国学校应该向中国新东方那样的学校学习.

That’s why Magic Math Mandarin is created.

Python for fun 开心玩Python

Lately we have been enjoying playing with turtle-drawing while watching this excellent series of videos of learning Python programming from KidsCanCode.   I place it as sticky so that it is easy for the children to find it.  I seriously had a lot of fun with these code because, even though I am an experienced programmer, programming for work is not this kind of pure fun.

Small learning steps + immediate results -> reward-> more small steps…-> more small rewards…-> repeat.
Both girls (7 and 9) are so ahead of the game.  Besides drawing, I explained the following concepts to the children although they may not remember.
IDEs
Onject oriented programming.

Victoria (our 7 year old) has been taking notes, which is compiled below:

import turtle

v=turtle.Pen()  ##v is named “Fred” in the video.  But Victoria likes her initial better than Fred for the name of the turtle

v.shape(“turtle”)

v.speed(0)

#1. a loop for drawing a series of circles that are seashell-like

for i in range(50):

v.circle(i*3)

v.left(10)

#2. a loop for drawing a red rose

v.reset()

v.color(“red”)

v.width(4)

for i in range(20):

v.circle(i*3,180) ##radius=i*3 and draw 1/2 of circle because 1/2=180/360

v.right(45)

copyright Magic Math Mandarin

#3. a loop for drawing a green lettuce-like picture

v.reset()

v.color(“green”)

v.width(5)

for i in range(100):

v.forward(i*2)

v.circle(i*2,90)

v.right(20)

#4. defining a function to draw squares so that we don’t have to type the loop again and again

def square(size): ##to define the function

for i in range(4):

v.forward(size)

v.left(90)

square(100)   ##to call the function and make it work

#5. use the square function we have defined and draw lots of “random” squares

import turtle
v=turtle.Pen()
import random
def square(size):
for i in range(4):
v.forward(size)
v.left(90)
square(100)
colorList=[“red”,”purple”,”yellow”,”green”,”orange”,”blue”,”brown”,”grey”]
v.speed(0)
v.width(5)
for i in range(100):
col=random.choice(colorList)
v.color(col)
x=random.randrange(-200,200)
y=random.randrange(-200,200)
v.up()
v.goto(x,y)
v.down()
size=random.randrange(10,200)
square(size)

copyright Magic Math Mandarin

200 random squares drawn by Victoria using turtle

#interactive

name=input(“What’s your name?”)

print(“Hello “,name)

age=int(input(“How old are you?”))  #int is to convert the string you input to a number because the program treats whatever you input (7, 8, 9, etc) as a string.

print(“Next year you will be “, age+1)

#Number guessing game: when you make a guess, try to pick the number always in the middle of the range (guess why 🙂

import random
secret=random.randrange(2, 200)
#print(secret)

guess=1
count=0
while guess !=secret:
guess=int(input(“Make a guess please:”))
count=count+1
if guess>secret:
print(“Your guess is too high.”)
elif guess<secret:
print(“Your guess is too small.”)
else:
print(“You got it! You guessed”,count,”times”)

#Fun rock, scissors and paper game

import random
moves = [‘r’,’p’,’s’]
you_win=[‘pr’,’sp’,’rs’]
play=”y”
win_count=0
tie_count=0
total_count=0
play=input(“Would you like to play? y/n”)
while play !=”n”:
    computer_move=random.choice(moves)
    your_move=input(“What is your move, r for rock, p for paper, or s for scissors:”)
    if your_move not in moves:
        print(“You have to enter r,p,s.”)
        your_move=input(“What is your move, r for rock, p for paper, or s for scissors:”)
    print(“You:”,your_move)
    print(“Me:”,computer_move)
    total_count=total_count+1
    if your_move==computer_move:
        print(“Tie”)
    tie_count=tie_count=0+1
    elif your_move+computer_move in you_win:
        win_count=win_count+1
    print(“Congratulations. You win! And you have won”,win_count, “time(s) out of “,total_count,         “times. We have”,tie_count,” tie(s).”)
    else:
        print(“Sorry, I win!”)

Kids making money and building things 小孩也能赚钱

In his youth, he sold coke at stadium, chewing gum door to door and then delivered papers, knew how buy, sell and short stocks. He bought his own car, and a farm with his own money and investments.  He became the most successful investor in the world.

More