3.11 作业

五角星绘制

import turtle
turtle.fillcolor('red')
turtle.begin_fill()
for i in range(5):
turtle.fd(200)
turtle.right(144)
turtle.end_fill()

import turtle

turtle.left(30)
turtle.fd(150)
turtle.right(120)
turtle.fd(150)
turtle.right(120)
turtle.fd(150)
turtle.right(120)
turtle.fd(50)
turtle.left(60)
turtle.fd(50)
turtle.right(120)
turtle.fd(150)
turtle.right(120)
turtle.fd(150)
turtle.right(120)
turtle.fd(150)

叠加等边三角形

import turtle
turtle.fd(200)
turtle.left(120)
turtle.fd(200)
turtle.left(120)
turtle.fd(200)
turtle.left(120)
turtle.fd(100)
turtle.left(120)
turtle.fd(100)
turtle.right(120)
turtle.fd(100)
turtle.right(120)
turtle.fd(100)

说句心里话A

x = input("")
y = input("")
str = x + ',我想对你说,' +y
print(str)

N的多次方

a = eval(input())
x = pow(a, 0)
y = pow(a, 1)
z = pow(a, 2)
k = pow(a, 3)
l = pow(a, 4)
m = pow(a, 5)
print(x, y, z, k, l, m)

世界,你好

print('世界,你好!')

M与N的数学运算

m = eval(input())
n = eval(input())
x = m + n
y = m * n
h = pow(m, n)
k = m % n
b = max(m, n)
print(x, y, h, k, b)

Hello world

str=input("")
str1='欢迎你,'+str+'同学!'
print(str1)

猜你喜欢

转载自www.cnblogs.com/hyocheong/p/12463301.html