Richard Trump

Four Methods For Merging Python 3 List

1. Use “+” Operator To Merge List Directly. >>> list_1 = [‘java’,’python’,’mysql’] >>> >>> list_2 = [100, 99, 101] >>> >>> print(list_1 + list_2) [‘java’, ‘python’, ‘mysql’, 100, 99, 101] >>> >>> print(list_2 + list_1) [100, 99, 101, ‘java’, ‘python’, ‘mysql’] >>> 2. Use List’s extend Method. The list’s extend method will extend current list …

Four Methods For Merging Python 3 List Read More »

How To Use Global Variable In Python Example

1. Variable Scope. Generally, variables defined outside of the function are called global variables, and variables defined inside the function are called local variables. Global variables are available in all scopes, and local variables are only available in it’s definition function. The order that different scope variables are called is local variable first, then global …

How To Use Global Variable In Python Example Read More »

What Is The Difference Between Python Class, Module, Package

1. Class. The concept of classe, which occurs in many programming languages, is fundamental to object-oriented programming and is easy to understand. Class is used to abstract the common characteristics of different objects, classify objects that are similar to each other into the same concept according to the similarity principle. Class encapsulates data and operations …

What Is The Difference Between Python Class, Module, Package Read More »

How To Resolve Could Not Find SSL Module Error After Install Python

When I import the python ssl module just after python is installed, it is prompted that ssl module cannot be found like below. This article will tell you how to resolve it. $ python Python 2.7.15 (default, Oct 23 2018, 18:08:43) >>> import ssl Traceback (most recent call last): File “<stdin>”, line 1, in <module> …

How To Resolve Could Not Find SSL Module Error After Install Python Read More »