1.
Print ("helloWorld") Hello World
2.
>>> name = input (" Enter Name:") Enter name: Guo Jing print ("{} classmate, Learn python well, promising! " . Format (name) Guo Jing students, learn python, promising! Print ("{} heroes, learn Python, promising! ") " . Format (Name[0]) learned, learn python, promising! Print ("{} brother, learn python, people love! ") . Format (name[1)) Jing elder brother, learn python, people see love!
3.
N1 = input (" Please enter first number:"= input (" Please enter second number:") Print (Float (N1) + float (n2))
4.
>>> a = float (input ("A:")) A:3>>> b = float (input (" B: " ) B:4>>> c = float (input ("C:")) C:5>>> s=0.5*a*b *cprint(S)725.6031973468695
5.
>>> r = 5>>> Area = 3.1415 * R * rprint(area)78.53750000000001
6.
Import turtleturtle.pensize (3) turtle.circle (ten) turtle.circle(turtle.circle) (30 ) turtle.circle(turtle.circle)turtle.circle(120)
7.
Import Turtle
Turtle.pensize (2)
Turtle.color ("Red")
Turtle.forward (100)
Turtle.left (144)
Turtle.forward (100)
Turtle.left (144)
Turtle.forward (100)
Turtle.left (144)
Turtle.forward (100)
Turtle.left (144)
Turtle.forward (100)
Turtle.left (144)
Turtle.forward (100)
8.
ImportTurtleturtle.pensize (2) Turtle.color ("Red") Turtle.fillcolor ("Red") Turtle.begin_fill () Turtle.forward (100) Turtle.left (144) Turtle.forward (100) Turtle.left (144) Turtle.forward (100) Turtle.left (144) Turtle.forward (100) Turtle.left (144) Turtle.forward (100) Turtle.left (144) Turtle.forward (100) Turtle.end_fill ()
Python input and output exercises, arithmetic exercises, turtle preliminary exercises