資訊內(nèi)容
我用Scratch和Python編程祝福送給您Merry Christmas!
圣誕節(jié)快樂
Merry Christmas
借著圣誕節(jié)的吉利,訴說心中的惦記。
伴隨圣誕節(jié)的歡喜,奉送永恒的支持,
把最溫馨的祝愿給您,
愿這個(gè)冬天飽含暖意。
A Merry Christmas and a wonderful New Year.
圣誕快樂,新年好!
May you have the best Christmas ever.
愿你度過最美好的圣誕節(jié)!
Thinking of you and wishing you a beautiful Christmas
season.
美麗的圣誕節(jié)之際,謹(jǐn)致我的思念與祝福。
Here is wishing you all a Merry Christmas and a New Year bright
with joy and success.
祝圣誕快樂,新年充滿幸福和成功。
Wishing you and your family a very merry Christmas.
祝福您及您的家人圣誕快樂。
Wishing you a song in your heart at Christmas and blessings all
year long.
圣誕之際,祝你心中有首快樂的歌,新年快樂!
圣誕節(jié)到了!
用編程的方式
Scratch編程動(dòng)畫與Python畫圣誕樹吧
Scratch編程動(dòng)畫送上圣誕祝福
部分角色代碼
Python畫圣誕樹送上祝福
與Scratch相比,Python屬高級(jí)語言。
1、入門圣誕樹
是不是感覺Python太簡單LOW了?
代碼如下:
height = 5
stars = 1
for i in range(height):
? ? print((' ' * (height - i)) + ('*' * stars))
? ? stars += 2
print((' ' * height) + ' |')
2、進(jìn)階圣誕樹
額,漂亮了許多。
部分代碼如下:
import turtle
screen = turtle.Screen()
screen.setup(800,600)
circle = turtle.Turtle()
circle.shape('circle')
circle.color('red')
circle.speed('fastest')
circle.up()
square = turtle.Turtle()
square.shape('square')
square.color('green')
square.speed('fastest')
square.up()
circle.goto(0,280)
circle.stamp()
k = 0
for i in range(1, 17):
? ? y = 30*i
? ? for j in range(i-k):
。。。。。。
需要完整源代碼的在公眾號(hào)后臺(tái)留言
3、高級(jí)圣誕樹
哇,好漂亮喔!
部分代碼如下:
from turtle import *
import random
import time
n = 80.0
speed("fastest")
screensize(bg='seashell')
left(90)
forward(3*n)
color("orange", "yellow")
begin_fill()
left(126)
for i in range(5):
? ? forward(n/5)
? ? right(144)
? ? forward(n/5)
? ? left(72)
