标签:input 简单 公式 where float 用户 fill 个数 sum
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))
num1=input("input a number:\n") num2=input("input an other number:\n") print(sum,end="") sum=num1+num2
a = float(input("输入第一边边长:")) b = float(input("输入第二边边长:")) c = float(input("输入第三边边长:")) s = (a + b + c) / 2 area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 print("三角形面积为 %0.2f" %area)
pi=3.1415926 r=float(input("请输入半径:")) area=pi*r*r print("面积为 %0.2f"%area)
import turtle turtle.speed(100) turtle.circle(10) turtle.circle(20) turtle.circle(30) turtle.circle(40)
import turtle turtle.speed(100) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144)
import turtle turtle.speed(100) turtle.fillcolor("yellow") turtle.begin_fill() turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.end_fill()
思考:
import turtle #draw first circle turtle.penup() turtle.goto(0,-200) turtle.pendown() turtle.circle(200) #draw second circle turtle.penup() turtle.goto(0,-150) turtle.pendown() turtle.circle(150) #draw third circle turtle.penup() turtle.goto(0,-100) turtle.pendown() turtle.circle(100) #draw fourth circle turtle.penup() turtle.goto(0,-50) turtle.pendown() turtle.circle(50)
标签:input 简单 公式 where float 用户 fill 个数 sum
原文地址:http://www.cnblogs.com/bb437601841/p/7483881.html