Basic learning of python 3

This paper is the notes and corresponding practice application in the process of self-learning python  , I hope it can help you, and I hope you can communicate and learn together catalogue 1, for loop -- iteration 1. Iterative dictionary 2. Some iterative tools 3. Reverse iteration and iteration after arrangement 4. Simple derivatio ...

Posted by flash-genie on Tue, 12 Oct 2021 11:44:30 -0700

Python Note -- Day 13.Object-oriented-higher order

19 Object-oriented - higher order 19.1 Built-in Members class A(): pass class C(): pass class B(C): pass class Demo(A,B): ''' Here is the documentation for the class ''' name = "XX" age = 30 def sing(self): print('the songs rhythm and melody') pass obj = Demo() # Gets the member to which the c ...

Posted by badboy1245 on Sun, 10 Oct 2021 10:01:01 -0700

Introduction to python

Introduction to python - learning notes [reference document]: https://www.runoob.com/python/python-variable-types.html [recommended documents]: https://blog.csdn.net/hhhhhhhhhhwwwwwwwwww/article/details/120037975 Some common settings of pycharm Enter setting > editor > file and code templates, click python script to set: """ ==== ...

Posted by uproa on Thu, 30 Sep 2021 19:01:35 -0700

Added login capabilities and corrections to previous Python registries

Think: A previously made registration system can store user registered names and passwords in a dictionary. Simply use if else statements to compare user names entered during user login with previously stored user names when user login. Passwords are the same. Practice: 1. First I want to compare the values, but I find that the keys in the di ...

Posted by MikeSnead on Thu, 30 Sep 2021 11:24:35 -0700

day9 - string job

Enter a string and print all characters in odd bits (subscripts are characters in bits 1, 3, 5, 7...) For example: input * *'abcd1234 '* * output * *'bd24'** # str1 = input('Please enter a string: ') str1 = 'abcd1234' for index in range(1 ,len(str1)+1,2): print(str1[index],end='') print() Enter the user name and judge whether the user na ...

Posted by andynick on Sun, 26 Sep 2021 12:57:10 -0700

Introduction and usage of functions in Python

1. Introduction to functions When developing a program, a piece of code needs to be written many times, but in order to improve the efficiency of writing and code reuse, the code block with independent functions is organized into a small module, which is function Rules for defining functions: The function code block begins with the def keywo ...

Posted by lenhewitt on Sun, 26 Sep 2021 03:00:31 -0700

Common class libraries for Python knowledge points

1. What is a time tuple? The processing time of 9 sets of numbers assembled by many Python functions in one meta: \ \ The above is struct_time tuple. This structure has the following properties: \ 2. Use datetime to get today's date and the date N days before Q: how do I get today's date in Python? How to get the date of the previous ...

Posted by JTapp on Sat, 25 Sep 2021 00:44:11 -0700

day8 - dictionaries and collections

day8 - dictionaries and collections 1 dictionary related operations and methods 1. The dictionary does not support addition, mu lt iplication and >, <, > =<= 2. Dictionary support = == print({'a': 10, 'b': 20} == {'b': 20, 'a': 10}) 3.in and not in Key in dictionary ---- judge whether the specified key exists in the dictionar ...

Posted by BRAINDEATH on Fri, 24 Sep 2021 07:08:55 -0700

[Python project practice] extract the pictures in the. docx file and save them to the specified folder

1, Demand analysis In order to meet the needs of users to quickly extract pictures from docx files to specified folders, the system should meet the following functions: When the user selects the docx file and specifies the image output path, all images in the docx file can be extracted.When the file selected by the user is not a docx file ...

Posted by cody44 on Thu, 23 Sep 2021 00:44:21 -0700

Python basic learning DAY2 (9.22)

1. Chain assignment: used to assign the same object to multiple variables. a=b=123 print(a) #123 print(b) #123 2. Series unpacking assignment: the series data is assigned to variables corresponding to the same number, and the number must be consistent. a,b,c=1,2,3 print(a) #1 print(b) #2 print(c) #3 a,b,c=1,2,3 a,b=b,a print(a) #2 print ...

Posted by ozzy on Wed, 22 Sep 2021 08:57:50 -0700