编辑
2022-03-05
代码世界
00
请注意,本文编写于 813 天前,最后修改于 610 天前,其中某些信息可能已经过时。

目录

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

The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists.

p1

First of all, install the PyCharm to configure my python environment.
Try to use the PyCharm to create my first Python program!

p2 (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

p3 (U can use the SHIFT + F9 to encode the codes by keyboard)

Then try a input:

p4

And some math?

p5

Let's try some circle, btw we can use the:

print(' ', end = ' ')

let it print for one line.

p6

If u want to input a num not a string as normal?

r = int(input())

Do a math of a circle?

p7

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

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

ALL IS GOOD!
And this is my first lesson to study Python, I got really much, see u next time!
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:Handy Zhang

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!