Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Articles - Page 908 of 1048
463 Views
In this article, we will be learning about min and max functions included in the Python Standard Library. It accepts infinite no of parameters according to the usageSyntaxmax( arg1, arg2, arg3, ...........)Return Value − Maximum of all the argumentsErrors & Exceptions: Here error is raised only in the scenario where the arguments are not of the same type. Error is encountered while comparing them.Let’s see what all ways we can implement the max() function first.Example Live Demo# Getting maximum element from a set of arguments passed print("Maximum value among the arguments passed is:"+str(max(2, 3, 4, 5, 7, 2, 1, 6))) # ... Read More
435 Views
In this article, we will be learning about union() i.e. one of the operations performed on the set() type. Union of all input sets is the smallest set which contains the elements from all sets excluding the duplicate elements present in sets.Syntax.union(, .......)Return type − typeSymbol − It is denoted by the first letter of function i.e. ‘U’ in probabilityExample Live Demo# Python 3.x. set union() function set_1 = {'a', 'b'} set_2 = {'b', 'c', 'd'} set_3 = {'b', 'c', 'd', 'e', 'f', 'g'} # union operation on two sets print("set_1 U set_2 : ", set_1.union(set_2)) print("set_3 U set_2 ... Read More
787 Views
Introduction to Object-Oriented Programming(OOP)?OOP refers to Object-Oriented Paradigm and is referred to as the heart of programming methodology. It includes several concepts like polymorphism, encapsulation, data hiding, data abstraction, inheritance & modularity.OOP gives data the prime consideration and by providing an interface through the functions associated with it. An object is a self-sufficient entity i.e. it has all the variables and associated functions with it. Objects have characteristics(variables) and features(methods), known as attributes.What is Modularity?Modularity refers to the act of partitioning the code into modules building them first followed by linking and finally combining them to form a complete project. ... Read More
209 Views
In this article, we will learn about generating & processing different timestamps using built-in pandas library. We are also using the numpy module to generate and modify the database needed for the timestamp generation.Preferable IDE: Jupyter notebookBefore beginning this tutorial we must install pandas and numpy library. For this jupyter notebook is the best place to test and run your code. For installing pandas we must run the following command.>>> pip install pandasIf we run this command all the dependencies are automatically installed. After it’s done we must restart the kernel to see the changes.After we finished installing all the ... Read More
3K+ Views
First-class citizens are entities that enable support for all the operations facilitating other fellow entities.These entities are often used : while passing an argument , returning a value from function , conditional modifications & value assignment.In this article, we will look at the implementation & usage of first-class citizens in Python 3.x or earlier. Also, we will be learning what all entities get the tag of being First Class citizens.These citizens include Variables along with functions.Let’s first get familiar with the data types that are part of First-class citizensIntegersFloating typeComplex NumbersStringsAll four types mentioned above are given the tag of ... Read More
295 Views
In this article, we will learn about the Learning Model Building in Scikit-learn: A Python Machine Learning Library.It is a free machine learning library. It supports various algorithm like the random forest, vector machines & k-nearest neighbours with direct implementation with numpy and scipy.Importing the datasetimport pandas Url = < specify your URL here> data=pandas.rad_csv(url)Data exploration and cleaningWe can use the head method to specify/filter the records according to our needs.data.head() data.head(n=4) # restricting the record to be 4We can also implement the last few records of the datasetdata.tail() data.tail(n=4) # restricting the record to be 4Now comes the stage ... Read More
2K+ Views
In this article, we will learn about the use of the Keyboard module in Python 3.x. Or earlier.Ide preferred − Jupyter notebookInstallation −>>> pip install keyboardFunctionalities of the module −Allows us to block the action of specific keysWe can manage intents from the keyboard using on click listeners.Cross-platform compatibility.Supports special & hotkeys available on the keyboard.Now let’s implement this in the form of code −Exampleimport keyboard # It writes the content keyboard.write("Tutorialspoint") # It writes end of line keyboard.press_and_release('shift + o, shift + y, ') keyboard.press_and_release('k, j') # it blocks until ctrl keyboard.wait('Ctrl')OutputTutorialspoint O Y k jExampleimport keyboard # It ... Read More
183 Views
In this article, we will learn about the scope of python and java in implementing the upcoming and trending technologies with ease.JavaFeatures of javaIt is object-orientedIt’s is platform-independentInvolves distributed computing and network capabilitiesMultithreading is supportedSecurity is prioritizedThe stack allocation system is availableSupported/ Available frameworksSpring framework( web applications)Grails ( dynamic environment)Java server facesGoogle web toolkitPlay frameworkStruts frameworkPythonFeatures of pythonInterpreted Object-Oriented languageModular, Dynamic and robust in naturePortableCross-platform compatibilityExtensible in C/C++Extensive library and third part dependencies supportSupported/ Available frameworksDjango framework( web-based application)Flask ( webserver)Tornado ( Web sockets )Sanic framework ( multi-level handling)Giotto framework( full stack development)Bottle framework ( Rest API’s)ConclusionIn this article, we ... Read More
842 Views
In this article, we will learn about Kivy framework and its installation. Kivy is a GUI based application interface, open-source that helps in cross-platform applications for Windows, Linux and Mac.Installation GuideFirstly we need to install python on pc.After that we need to install the dependencies −Windows −>>> python -m pip install docutils pygments pypiwin32kivy.deps.sdl2 kivy.deps.glew >>> python -m pip install kivy.deps.gstreamer >>> python -m pip install kivy.deps.angleLinux −$ sudo add-apt-repository ppa:kivy-team/kivyInstalling the Kivy fileWindows −>>> python -m pip install kivyLinux −>>> sudo apt-get install python3-kivyNow let’s see how we can make a graphical user interface using Kivy −Exampleimport kivy kivy.require('1.10.0') ... Read More
383 Views
In this article, we will learn about What is the Python Global Interpreter Lock (GIL).This is a lock or hindrance that resistant the availability of the Python interpreter to multiple threads simultaneously. GIL is identified as a fault/issue in Python 3.x. Or earlier as it doesn’t allow multithreading in a multi-threaded architecture.Why is it introduced?Python supports the concept of automatic garbage collection. As soon as the reference count of an object reaches zero the memory is cleaned and free for usage.>>> import sys >>> var = {} >>> print(sys.getrefcount(ar)) >>> 2 >>> v=var >>> print(sys.getrefcount(v)) >>> 3Of in this case ... Read More