Python Program Basic Architecture

Source: Internet
Author: User

Python's general Program Basic architecture is: input, processing, output , these three blocks.

Input: Includes two content, variable assignment and input statement

Processing: including arithmetic operations, logical operations, algorithmic processing of these three aspects

Output: Includes printout, write to file, write to database three blocks

Here are two examples to learn more about Python's Basic program architecture

1

Input: Variable Assignment

Processing: arithmetic operations

Output: Print output

x = #变量赋值x =12 y = #变量赋值y =13 z = x + y #算术运算 print (z) #打印输出 25

2

Input: Input statement

Processing: Algorithmic processing (function processing)

Output: Print output

STR1 = raw_input ("Input a string:") #输入语句, Raw--input is a function, his role is to input the keyboard characters, the input results are assigned to STR1, behind () is a hint string, Its role is to enhance the friendliness of the interactive interface input a string: #输入51cto网站 print (STR1) #打印输出
n = Len (str1) #len函数作用查看字符个数, assigns the result to Nprint (n) #使用print查看字符个数13 #51cto网址字符个数13个


This article is from "Zhang Fan-it's fantasy drifting" blog, please be sure to keep this source http://chawan.blog.51cto.com/9179874/1560378

Python Program Basic Architecture

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.