
Text version of the archived Python mind map
This text alternative follows the branches of the archived diagram. It preserves the image’s examples and identifies its set-output annotations as historical labels rather than verified current output. The image is a reference sketch, with several unexpanded branches.
- Overview
The diagram is titled “python3 in one pic”. Its main branches are import this, Syntax Roles, Native Datatypes, Operators & Casting, Flow Control, Function, Class (OOP), Module, Pythonic, and Standard Libraries. Only the native-data-type and flow-control branches have expanded examples. A small ≡ symbol appears under Syntax Roles.
- Numbers: integers
a = 1 b = 0x10 # 16 print(type(a)) # <class 'int'>- Numbers: floating point
c = 1.2 d = .5 # 0.5 g = .314e1 # 3.14 print(type(g)) # <class 'float'>- Numbers: complex
e = 1+2j f = complex(1, 2) print(type(e)) # <class 'complex'> print(f == e) # True- Number operators
+ - * / % **- Strings
s1 = '🐶\n' s2 = "Dogge's home" s3 = """ Hello, Dogge! """ print(type(s1)) # <class 'str'> print("%s, %s, %s" % (s1, s2, s3)) # 🐶 # , Dogge's home, # Hello, # Dogge! print(len(s1)) # 2 s = '学而时习之' print('{0}:{1}'.format(s[0], s[-2])) # 学:习- Bytes
# The image labels this branch “list of ascii character” and “0–255/x00–xff”. byt = b'abc' print(type(byt)) # <class 'bytes'> print(byt[0] == 'a') # False print(byt[0] == 97) # True print(len(byt)) # 3- Boolean and None
True False print(type(True)) # <class 'bool'> print(None is None) # True print(type(None)) # <class 'NoneType'>- Lists: creation, length and slicing
l = ['python', 3, 'in', 'one'] print(type(l)) # <class 'list'> print(len(l)) # 4 print(l[0]) # 'python' print(l[-1]) # 'one' print(l[1:-1]) # [3, 'in']- Lists: alteration and index
l.append('pic') # None # l == ['python', 3, 'in', 'one', 'pic'] l.insert(2, '.4.1') # None # l == ['python', 3, '.4.1', 'in', 'one', 'pic'] l.extend(['!', '!']) # None # l == ['python', 3, '.4.1', 'in', 'one', 'pic', '!', '!'] print(l.pop()) # '!' # l == ['python', 3, '.4.1', 'in', 'one', 'pic', '!'] print(l.pop(2)) # '.4.1' # l == ['python', 3, 'in', 'one', 'pic', '!'] l.remove("in") # l == ['python', 3, 'one', 'pic', '!'] del l[2] # l == ['python', 3, 'pic', '!'] print(l.index('pic')) # 2- Tuples
# The diagram labels a tuple “Immutable list”. tp = (1, 2, 3, [4, 5]) print(type(tp)) # <class 'tuple'> print(len(tp)) # 4 print(tp[2]) # 3 tp[3][1] = 6 print(tp) # (1, 2, 3, [4, 6]) # Single element: tp = (1,) # Not tp = (1) # Assign multiple values: v = (3, 2, 'a') (c, b, a) = v print(a, b, c) # a 2 3- Sets
st = {'s', 'e', 'T'} print(type(st)) # The archived image prints <class 'list'> beside this line. print(len(st)) # 3 # Empty: st = set() print(len(st)) # 0 st = {} print(type(st)) # <class 'dict'> # Alter: st = set(['s', 'e', 'T']) st.add('t') st.add('t') st.update(['!', '!']) st.discard('t') st.remove('T') st.pop() st.clear()- Set state annotations in the image
After the first and repeated st.add('t'), the displayed states both contain 's', 'e', 't', and 'T'. The st.update annotation displays 's', 'e', 't', 'T', '!', and '!' (including the repeated exclamation mark shown in the image). After st.discard('t'), the displayed members are 's', 'e', 'T', and '!'. After st.remove('T'), the displayed members are 's', 'e', and '!'. The image shows st.pop() returning 's', leaving 'e' and '!'. After st.clear(), it displays set(). These are transcribed historical image annotations, not independently generated output.- Dictionaries
dic = {} print(type(dic)) # <class 'dict'> dic = {'k1': 'v1', 'k2': 'v2'} print(len(dic)) # 2 print(dic['k2']) # 'v2' print(dic.get('k1')) # 'v1' print(dic.get('k3', 'v0')) # 'v0' dic['k2'] = 'v3' print(dic) # {'k1': 'v1', 'k2': 'v3'} print('k2' in dic) # True print('v1' in dic) # False- Flow control: if
import sys if sys.version_info.major < 3: print("Version 2.X") elif sys.version_info.major > 3: print("Future") else: print("Version 3.X")- Flow control: for and while loops
for i in 'Hello': print(i) prod = 1 i = 1 while i < 10: prod = prod * i i += 1 print(prod)
The Great Guide
While the above picture completely explains each dimension of Python, this guide with further help you understand what Python actually is and how it works.Why is Python?
Python has taken the programming community to the next level with its rich features and vivid functionality. This makes it an important next-generation skill to develop. As it is a free source and many-in-one programming language, it is easier to learn and serves different purposes. Since its release in 1991, it has gone through various improvements and so, has evolved. Now, Python is more refined and functional than it was a decade ago.What makes Learning Python 3 Important?
Python 3 comes with a number of advantages as compared to other programming languages. This is mainly due to its reusability and flexibility attached to the programs. Be it machine learning, deep learning, artificial intelligence or any other modern domain, Python 3 is easy to implement. This is because its numerous modules allow to implement programs in an easier way. Moreover, Python 3 is reliable and has great community support. It is not only portable but highly efficient as it offers clear structural specifications when writing any code. With no traditional and old-style programming syntax, Python 3 is the favorite language of hackers and security researchers. As reading Python code is easier and efficient, it gives Python an upper hand among its competitors like Java R and Go Lang. When it comes to developer forum, Python 3 has gained a lot of popularity in a short period of time. Python 3 serves a lot of uses due to its exceptional features and advantages. It helps implement various technologies such as Machine Learning, Web Design and Data Analytics etc. Also, it offers application development, array handling, and complex matrix functions and data visualization.Some Popular Applications of Python 3
To your surprise, all the applications that are widely popular and in-demand nowadays use Python 3. Following are the bunch of applications that are developed with Python 3 code:Fundamentals of Python 3
After going through the important features and uses of Python 3, you must be thinking where to start learning it. The following are some fundamentals of Python 3, also described and used in the picture above:- Variables and operators
- Conditionals and loops
- I/O operations
- Modules
Where to Learn?
When it comes to various learning platforms for Python 3, Pluralsight and CBT Nuggets are two prominent ones. Both offer a number of videos to learn Python 3 with great ease and efficiency. However, when it comes to the showdown between Pluralsight and CBT Nuggets, Pluralsight is the prominent winner. It comes with a wider range of videos and more professional methodology, especially for beginners. If you’re weighing up the cost, check what a plan with the courses you want costs today.We make some money when you purchase a product from a link on our website. If you found the content helpful, please use the link to get to the chosen provider of your choice. It doesn’t cost you a thing and it helps us put out great content. The money involved does not effect the ratings of any given product or service, we just link to an affiliate if there is one available after we write the article.
Disclaimer
Have a question about this article? Get in touch with us.