Python input and output exercises, arithmetic exercises, turtle preliminary exercises

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.