The first week of Python automation development and learning, and the first week of python Automation

Source: Internet
Author: User

The first week of Python automation development and learning, and the first week of python Automation

1. Development History of python

2. What language is python?
Compiled or interpreted? Python is an interpreted language.

Advantages of python: easy to understand, high development efficiency, advanced language, portability, scalability, and embedability
Disadvantages: slow speed, Code cannot be encrypted, and threads cannot use multiple CPUs

3. Install python

Install Python 2 and Python 3 in Windows:
Http://edu.51cto.com/course/course_id-6823.ht

Python in linux


4. compiled the first python program.
#! /Usr/bin/env python

Print ("hello, world ")


5. Install pycharm


6. learned the variables.
Variable definition rules
Variable names can only be any combination of letters, numbers, or underscores
The first character of the variable name cannot be a number.
Other keywords cannot be declared as variable names.

['And', 'as', 'assert ', 'Break', 'class', 'contine', 'def', 'del ', 'elif ', 'else', 'Got t', 'exec ', 'Finally', 'for ', 'from', 'global', 'if', 'import', 'in ', 'Is ', 'lambda', 'not ',' or ', 'pass', 'print', 'raise ', 'Return', 'try', 'while ', 'with', 'yield ']
Constants are in uppercase.

Character encoding: ASCII ---- unicode --- uft-8

7.

Note
Single Row #
Use three quotation marks for multiple rows """"""''''''

User input
Name = input ("name :")
Age = input ("age :")
Job = input ("job :")
Salary = input ("salary :")

Info = '''
----------- Info of % s -----------
Name: % s
Age: % s
Job: % s
Salary: % s
''' % (Name, name, age, job, salary)

Info2 = '''
----------- Info of {name }-----------
Name: {name}
Age: {age}
Job: {job}
Salary: {salary}
'''. Format (name = name, age = age, job = job, salary = salary)


Info3 = """
----------- Info of {0 }-----------
Name: {0}
Age: {1}
Job: {2}
Salary: {3}
". Format (name, age, job, salary)

 

Print (info3)

 

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.