Found 10784 Articles for Python

Is the future with snake(Python) or Coffee(Java)?

Pavitra
Updated on 28-Aug-2019 14:04:53

104 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

Introduction to Kivy; A Cross-platform Python Framework

Pavitra
Updated on 28-Aug-2019 13:56:32

692 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

What is the Python Global Interpreter Lock (GIL)

Pavitra
Updated on 28-Aug-2019 13:52:08

228 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

Vectorization in Python

Pavitra
Updated on 28-Aug-2019 13:47:51

856 Views

In this article, we will learn about vectorization and various techniques involved in implementation using Python 3.x. Or earlier.What is Vectorization?Vectorization is a technique to implement arrays without the use of loops. Using a function instead can help in minimizing the running time and execution time of code efficiently. Various operations are being performed over vector instead of arrays such as dot product of vectors which is also known as scalar product as it produces single output, outer products which results in square matrix of dimension equal to (length X length) of the vectors, Element wise multiplication which products the ... Read More

isprintable() in Python and its application

Pavitra
Updated on 28-Aug-2019 13:21:48

150 Views

In this article, we will learn about isprintable() in Python and its application.Is printable() is a built-in method used for the purpose of string handling. The isprintable() methods return “True” when all characters present in the string are of type printable or the string is empty, Otherwise, It returns a boolean value of “False”.Arguments − It doesn’t take any argument when calledList of printable characters include digits, letter, special symbols & spaces.Let’s look at this illustration to check that whether the characters of string are printable or not.Example Live Demo# checking for printable characters st= 'Tutorialspoint' print(st.isprintable()) # checking if ... Read More

Introduction To Machine Learning using Python

Pavitra
Updated on 28-Aug-2019 13:14:12

219 Views

In this article, we will learn about the basics of machine learning using Python 3.x. Or earlier.First, we need to use existing libraries to set up a machine learning environment>>> pip install numpy >>> pip install scipy >>> pip install matplotlib >>> pip install scikit-learnMachine learning deals with the study of experiences and facts and prediction is given on the bases of intents provided. The larger the database the better the machine learning model is.The flow of Machine LearningCleaning the dataFeeding the datasetTraining the modelTesting the datasetImplementing the modelNow let’s identify which library is used for what purpose −Numpy − adds ... Read More

Program to reverse an array up to a given position in Python

Hafeezul Kareem
Updated on 27-Aug-2019 13:02:36

755 Views

In this tutorial, we will learn how to reverse an array upto a given position. Let's see the problem statement.We have an array of integers and a number n. Our goal is to reverse the elements of the array from the 0th index to (n-1)th index. For example, Input array = [1, 2, 3, 4, 5, 6, 7, 8, 9] n = 5 Output [5, 4, 3, 2, 1, 6, 7, 8, 9]Procedure to achieve the goal. Initialize an array and a number Loop until n / 2. Swap the (i)th index and (n-i-1)th elements.Print the array you will get the result.Example## initializing array and ... Read More

Python program to remove leading zeros from an IP address

Hafeezul Kareem
Updated on 27-Aug-2019 12:52:36

394 Views

In this tutorial, we are going to write a program which removes leading zeros from the Ip address. Let's see what is exactly is. Let's say we have an IP address 255.001.040.001, then we have to convert it into 255.1.40.1. Follow the below procedure to write the program.Initialize the IP address.Split the IP address with. using the split functionConvert each part of the IP address to int which removes the leading zeros.Join all the parts by converting each piece to str.The result is our final output.Example## initializing IP address ip_address = "255.001.040.001" ## spliting using the split() functions parts = ip_address.split(".") ## ... Read More

Python program to merge two Dictionaries

Hafeezul Kareem
Updated on 27-Aug-2019 12:48:32

496 Views

In this tutorial, we are going to learn how to combine two dictionaries in Python. Let's see some ways to merge two dictionaries.update() methodFirst, we will see the inbuilt method of dictionary update() to merge. The update() method returns None object and combines two dictionaries into one. Let's see the program.Example## initializing the dictionaries fruits = {"apple": 2, "orange" : 3, "tangerine": 5} dry_fruits = {"cashew": 3, "almond": 4, "pistachio": 6} ## updating the fruits dictionary fruits.update(dry_fruits) ## printing the fruits dictionary ## it contains both the key: value pairs print(fruits)If you run the above program, Output{'apple': 2, 'orange': 3, ... Read More

Python program to find all duplicate characters in a string

Sarika Singh
Updated on 26-Aug-2023 08:14:18

33K+ Views

This article teaches you how to write a python program to find all duplicate characters in a string. Characters that repeat themselves within a string are referred to as duplicate characters. When we refer to printing duplicate characters in a string, we mean that we shall print every character, including spaces, that appears more than once in the string in question. Input-Output Scenarios Following is the input-output scenario to find all the duplicate characters in a string − Input: TutorialsPoint Output: t, o, i As we can see, the duplicate characters in the given string "TutorialsPoint" are "t" with ... Read More

Advertisements