python_day1 essays

the p- ython advantages and disadvantages:

Python's advantages are many, simple can be summarized as follows.

  1. Simple and clear, do one thing only one way.

  2. Low learning curve compared with many other languages, Python is easier to use.

  3. Open source, has a strong community and ecosystem.

  4. Interpreted language, inherently platform portability.

  5. It supports two mainstream programming paradigm (object-oriented programming and functional programming) have provided support.

  6. Scalability and embeddable can be called C / C ++ code can also call Python in C / C ++ in.

  7. High degree of standardized codes, readable, there are codes for obsessive compulsive disorder and crowd.

Python shortcomings mainly in the following points.

  1. Slightly lower efficiency and therefore computationally intensive tasks can be written in C / C ++.

  2. Code can not be encrypted, but now many companies are not selling software, but selling services, the issue will be diluted.

  3. Too many in the development framework that can be selected (such as Web framework there are more than 100), have a choice where there is an error.

Under Windows environment to build:

  May Python official website to download the Python Windows Installer (exe files), it should be noted that if the installation need to install Service Pack 1 patch package in the Windows 7 environment (can automatically install system patches through a number of tools software features to install ), the installation process is recommended by checking the "Add Python 3.6 to PATH" (Python 3.6 added to the PATH environment variable) and choose a custom install, set "Optional Features" interface is best to "pip", "tcl / tk ", "Python test suite" all other items on the check. It is strongly recommended to use a custom installation path and ensure that the path is not Chinese.

  and c language python, java language more different, but the most simple. If you learned C language with java man, as far as possible when writing python will have become accustomed to the C language and writing java try to forget, or back often wrong when writing the python.

The first python program:

  

 

Experience with python painting:

 

Use python to write a simple addition and subtraction, multiplication and division:

python enter a name, and then output ...... You're ugly

 

 写出一个用*号组成的正方形

 

课后作业:

1题

c=float(input("请输入摄氏度:"))
f=(9/5)*c+32
print("%d 摄氏度是%d 华氏度" %(c,f))

2题

import math
r,h=map(float,input("请输入圆柱的底面半径与高:").split())
area=r*r*math.pi
volume=area*h
print("底面积为:%.4f" %(area))
print("体积为:%.1f" %(volume))

3题

feet=float(input("请输入英尺数:"))
print("%d英尺等于%.4f米"%(feet,feet*0.305) )

4题

M=float(input("请输入水量:"))
it=float(input("请输入初始温度:"))
ft=float(input("请输入最终温度:"))
Q=M*(ft-it)*4184
print("所需要的热量为:%.1f"%(Q))

5题

balance,interest_rate=map(float,input("请输入差额和年利率: ").split())
rate=balance*(interest_rate/12000)
print("利息为:%.5f"%(rate))

6题

v0,v1,t=map(float,input("请输入v0,v1和t:").split(","))
a=(v1-v0)/t
print("加速度为: %.4f"%(a))

7题

money=float(input("每月存入钱数:"))
for i in range(6):
    s=money*(1+0.00417)
    money=100+s
print("第六月账户钱数: %.3f"%s)

8题

n=int(input("请输入一个0-1000的整数"))
baiwei=int(n//10/10)
shiwei=n//10%10
gewei=n%10
print("输入数字各位之和为: %d"%(baiwei+shiwei+gewei))

Guess you like

Origin www.cnblogs.com/shy13138/p/11272767.html