首页 > 编程语言 > 详细

Python输入输出练习,运算练习,turtle初步练习

时间:2017-09-06 12:05:00      阅读:233      评论:0      收藏:0      [点我收藏+]
print("Hello World!!")
name=input("what is your name?\n")
where=input("where are you now?\n")
age=input("how old are you ?\n")
print("your name is {}".format(name))
print("you live in {}".format(where))
print("you are {} years old".format(age))
a=input("请输入第一个数字:")
b=input("请输入第二个数字:")
sum1=float(a)+float(b)
print("两数之和:{}".format(sum1))
a=float(input("第一条边长:"))
b=float(input("第二条边长:"))
c=float(input("第三条边长:"))
p=(a+b+c)/2
s=(p*(p-a)*(p-b)*(p-c))**0.5
print ("三角形的面积为{}".format(s))
r=float(input("圆的半径:"))
s=3.14*r*r
print("圆的面积为{}".format(s))
import turtle
turtle.speed(100)
turtle.circle(10)
turtle.circle(20)
turtle.circle(30)
turtle.circle(40)
import turtle
turtle.begin_fill()
turtle.fillcolor("blue")
turtle.color("blue")
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)
turtle.end_fill()

 

Python输入输出练习,运算练习,turtle初步练习

原文:http://www.cnblogs.com/hzl123/p/7483941.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!