Python Base language

Source: Internet
Author: User

First of all: I am now the Python language beginner, if any crossing feel wrong, please criticize the guidance, let me grow from it, thank you!

The Python language is much less specific than the C, C #, and Java languages, for example, in the Python loop statement, which is for I in rang (number), which represents how many loops, but the C language must declare the variable in the declaration area, then the for (i=0;i <number;i++), and then loop through the curly braces, but Python is forced to indent, which reduces the lack of parentheses, but in some ways it makes the program more readable.

I learn the Python language from the most basic symbols, frameworks, and run structures.

Below I want to write a simple Python language programming in order to attract the big crossing and the great God in my comment area to attach to me the N-Python script let me learn:

Guess Age Game

Age=22

Counter=0

For I in range (10):

Print (i)

Print ("-->counter", counter)

If counter<3:

guess_num = Int (input ("input"-you guess number if you see my Picture: "))

if Guess_num = = Age:

Print ("Congratulation you! That's right ")

Continue

Elif Guess_num>age:

Print ("You guess wrong, I advice can write a little number")

Else

Print ("You guess wrong, I think can write a big number")

Else

Print ("Stupid man!do do want to need another choice?" ")

if (continue_confirm = = ' Y ')

Counter=0

Continue

Else

Print ("Stupid man!good Bye")

Break

Counter+=1

The code is relatively simple, the only purpose is to ask the big guys to drop me a face, let me in your dump my face at the same time, and then progress, and strive to be like you write a better Python program.

If you crossing not be able to give me the evaluation, I wrote on the blog, and then the process of blogging to grow.

This article is from the "11516031" blog, please be sure to keep this source http://11526031.blog.51cto.com/11516031/1978745

Python Base language

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.