请注意,本文编写于 875 天前,最后修改于 672 天前,其中某些信息可能已经过时。
目录
First of all, install the PyCharm to configure my python environment.
Try to use the PyCharm to create my first Python program!
Let's code a REAL hello world! lolllll
Then try a input:
And some math?
Let's try some circle, btw we can use the:
let it print for one line.
If u want to input a num not a string as normal?
Do a math of a circle?
This is the point!
How to print a num in Binary/Octal/Hex!
Here it is!
Let's do some big!
Try to find the MAX/MIN/AVERAGE num from a num list!
ALL IS GOOD!
And this is my first lesson to study Python, I got really much, see u next time!
原文连接:https://github.com/handyZYG/Python_Study/issues/2
![python](https://user-images.githubusercontent.com/80324720/163903076-e1d5c5ca-e19f-43ba-929c-22c155b6f633.png)
The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists.
![p1](https://user-images.githubusercontent.com/80324720/163902608-7c9caee7-f00c-408c-b2d2-61df52a8a512.png)
Try to use the PyCharm to create my first Python program!
(That is not only the Hello world program, but also the big step to study the Python!XD
Let's code a REAL hello world! lolllll
(U can use the SHIFT + F9 to encode the codes by keyboard)
![p4](https://user-images.githubusercontent.com/80324720/163903376-6fe73031-4e6e-4f1b-8691-f5d89d057387.png)
And some math?
![p5](https://user-images.githubusercontent.com/80324720/163903425-ec012a0d-2c08-462d-8075-8136f3707a11.png)
Let's try some circle, btw we can use the:
print(' ', end = ' ')
let it print for one line.
![p6](https://user-images.githubusercontent.com/80324720/163903620-aaebac59-f707-4a60-8cdd-e517810017d2.png)
r = int(input())
Do a math of a circle?
![p7](https://user-images.githubusercontent.com/80324720/163903790-4a67e782-cc68-4df2-b86e-3963fe2aa7e9.png)
This is the point!
How to print a num in Binary/Octal/Hex!
a = int(input()) str1 = str(bin(a)) print(str1[2:], end=' ') str2 = str(oct(a)) print(str2[2:], end=' ') str3 = str(hex(a)) print(str3[2:])
Here it is!
![p8](https://user-images.githubusercontent.com/80324720/163904056-72ddac92-ee54-41de-b62e-48ba5fc0d5ed.png)
Let's do some big!
Try to find the MAX/MIN/AVERAGE num from a num list!
n = int(input()) list1 = list(map(eval,input().split())) Max = str(max(list1)) print('max=%s' % Max) Min = str(min(list1)) print('min=%s' % Min) sum = 0 for i in range(n): sum = sum + list1[i] Avg = sum/n print('average=%.2f' % Avg)
![p9](https://user-images.githubusercontent.com/80324720/163904263-fa270db1-f3b3-49c2-8255-a2b865796087.png)
ALL IS GOOD!
And this is my first lesson to study Python, I got really much, see u next time!
本文作者:Handy Zhang
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA
许可协议。转载请注明出处!