1. 程式人生 > >Python第一節課

Python第一節課

{} format rtl imp gre world 3.1 oat cnblogs

print("hello world")
name=input("What‘s your name:")
print("{},it is good for you to study Phython!".format(name))
a=input("a:")
b=input("b:")
print(float(a)+float(b))
a=input("a=")
b=input("b=")
c=input("c=")
l=(float(a)+float(b)+float(c))/2
d=float(l)*(float(l)-float(a))*(float(l)-float(b))*(float(l)-float(c))
s
=float(d)**0.5 print(float(s))
r=input("r=")
s=3.14*float(r)*float(r)
print(float(s))
import turtle

turtle.shape(turtle)
turtle.speed(5)
turtle.color(red)
turtle.circle(50)
turtle.circle(75)
turtle.circle(100)
import turtle
turtle.forward(200)
turtle.right(144)
turtle.forward(200)
turtle.right(144)
turtle.forward(
200) turtle.right(144) turtle.forward(200) turtle.right(144) turtle.forward(200) turtle.right(144)
import turtle
turtle.shape(turtle)
turtle.speed(50)
turtle.color(green)
turtle.forward(200)
turtle.right(144)
turtle.forward(200)
turtle.right(144)
turtle.forward(200)
turtle.right(144)
turtle.forward(200)
turtle.right(
144) turtle.forward(200) turtle.right(144)

Python第一節課