1.The founder of python is Guido van Rossum ,he created it on Christmas in 1989, smriti of ABC language. 2.python can be used in many areas , such as data analysis / Internet Service/ Image Processing and so on. 3.python is an interpretive language…
An inch is worth a pound of gold, an inch of gold is hard to buy an inch of time. Slice When the scale of data is so large that we have to pick a short of the content, the best way is to use Slice. Forward Slice >>>L=range(1,101) >>>L[1:…
OK, let's continue. Conditional Judgments and Loop if if-else if-elif-else while for break continue multiple loop Differences between Dict and Set Dict: A kind of structure in the type of "Key-Value" described in "{}" formed by "k…
After a short period of new year days, I found life a little boring. So just do something funny--Python. Before we begin, what we should know first is that Python is a dynamic language, which means the type of data of every varieable Differences Bet…
1. Set Set is a collection which is unordered and unindexed. No duplicate members In Python sets are written with curly brackets { } set1 = {'apple', 'banana', 'cherry'} list1 = [1, 2, 3, 4, 5] list_set = set(list1) print(set1) print(list_set, type(…
1. Built-in Modules and Functions 1) Function def greeting(name): print("Hello,", name) greeting("Alan") 2) import os import os os.system("dir") 2. Number types 1) int int, or integer, is a whole number, positive or negat…
整体大纲关于占位符 tpl = "i am %s" % "alex" tpl = "i am %s age %d" % ("alex", 18) tpl = "i am %(name)s age %(age)d" % {"name": "alex", "age": 18} 函数:len() 1:作用:返回字符串.列表.字典.元组等长度…
# 多进程 # Windows下面没有fork ,请在linux下跑下面的代码 import os print('Process (%s) start...' % os.getpid()) pid = os.fork() if pid==0: print('I am child process (%s) and my parent is %s' % (os.getpid(), os.getppid()) else: print('I (%s) just created a child proce…