Found 10784 Articles for Python

Python program to add two octal numbers

Niharika Aitam
Updated on 02-Aug-2023 11:37:28

154 Views

An octal number is a number expressed in the base-8 numeral system. It uses digits from 0 to 7. Octal numbers are commonly used in computer science and digital systems, especially when dealing with groups of three bits. In octal notation, each digit represents an increasing power of 8. The rightmost digit represents 8^0 (1), the next digit represents 8^1 (8), the next digit represents 8^2 (64), and so on. By combining these digits, octal numbers can represent positive integers. For example, the octal number 52 represents the decimal number as follows. (5 * 8^1) + (2 * 8^0) = ... Read More

Python Program that Sends and Receives Message from Client

Niharika Aitam
Updated on 02-Aug-2023 11:36:17

100 Views

Python socket is a set of modules used for socket programming, which enables communication between processes over IP networks. Sockets in Python provide the backbone for most network programming tasks. By importing relevant modules, we can write Python programs to create client and server programs for different types of network applications such as web scraping, file transfer, email clients, and chat applications. The "socket" module is the most important module of socket programming in Python. It provides different types of connection-oriented and connection-less sockets that implement specific protocol levels such as TCP, UDP, etc. TCP (Transmission Control Protocol) sockets TCP ... Read More

Python program that renders a dictionary from two list with K values

Niharika Aitam
Updated on 02-Aug-2023 11:34:06

59 Views

A Dictionary is an unordered collection of data structure which stores the elements as key and value. It is mutable and in other programming languages Dictionaries are also known as associative arrays, hash maps, or hash tables. The key is the unique one and the values are of a single element or a list of elements with duplicates. A Dictionary can be created by using the curly braces {} or by using the built in function dict(). Let’s see an example of creating the dictionary in python. Example student = { 'name': 'Tutorialspoint', 'age': ... Read More

Progress Bars in Python

Niharika Aitam
Updated on 02-Aug-2023 11:33:09

2K+ Views

Progress bars in Python are visual indicators that provide feedback on the progress of a task or operation. They are useful for long-running processes or iterations where it's helpful to show how much work has been completed and how much is remaining. A progress bar typically consists of a visual representation, such as a horizontal bar or a textual representation, which dynamically updates to reflect the progress of the task. It also includes additional information like the percentage of completion, estimated time remaining, and any relevant messages or labels. The following are the purposes served by the progress bars in ... Read More

Programming Paradigms in Python

Niharika Aitam
Updated on 02-Aug-2023 11:32:03

2K+ Views

Programming paradigm is a specific approach or style of programming that provides a framework for designing and implementing computer programs. It encompasses a set of principles, concepts, and techniques that guide the development process and the structure of the code. Different paradigms have different ways of solving problems, organizing code, and expressing computations. The below are the various programming paradigms available in python which makes the developer work easy and more efficient. Procedural Programming Procedural programming focuses on dividing a program into a set of procedures or functions. In Python, we can define functions to perform specific tasks and structure ... Read More

Program to calculate Dooms Day for a year

Niharika Aitam
Updated on 02-Aug-2023 11:30:15

108 Views

The doomsday is also known as the doomsday of the week which is a specific day of the week that falls on the same date every year. The concept of the doomsday is based on the doomsday algorithm, which allows us to determine the day of the week for any given date. The doomsday algorithm was developed by mathematician John Horton Conway and is based on the idea that certain dates within each year fall on the same day of the week called the doomsday. The doomsday occurs on the following dates − January 3rd February 7th or 14th ... Read More

Program to access different columns of a multidimensional Numpy array

Niharika Aitam
Updated on 02-Aug-2023 11:28:57

77 Views

Numpy is the most powerful library in python for computing numerical data. It provides multidimensional arrays, along with different collections of functions and modules to work with arrays. Its efficient array operations, broadcasting capabilities, and integration with other libraries make it a go-to choice for data manipulation, analysis, and modeling tasks. The following are the key features and functionalities of the Numpy library. Multidimensional arrays Array creation Array operations Indexing and Slicing Vectorized operations Numerical Routines Integration with other libraries Performance Open source and community support Creation of an array In Numpy library we have the functions called ... Read More

Ways to Check if a given String in Python Contains Only Letters

Aayush Shukla
Updated on 01-Aug-2023 14:08:16

163 Views

Python is used by programmers all over the world for different purposes such as web development, data science, machine learning and to perform various different processes with automation. In this article we are going to learn about different ways to check if a given string in python contains only characters. Different Methods to check if a given string contains only letters Isalpha Function This is the simplest method of checking if a given string in python contains letters. It will give the output as true and false as per the presence of letters in the string. Let’s take an example ... Read More

Union Operation of two Strings using Python

Aayush Shukla
Updated on 02-Aug-2023 18:18:47

341 Views

Python is a very commonly used language by programmers all over the world for different purposes such as machine learning, data science, web development and to perform many other operations with automation. It has many different features which help us to work on many different projects. One such feature of python is the union operation. The union operation means to combine two different strings into one common string after removing all the common elements in both the string. In this article we are going to learn about different methods which can be used for union operation of two strings. Different ... Read More

Removing the Initial Word from a String Using Python

Aayush Shukla
Updated on 01-Aug-2023 13:54:20

66 Views

Python is a commonly used programming language used for many different purposes such as Web development, data science, machine learning and to perform many different processes with automation. In this article we will learn how to remove the initial word from a string using python. Different Methods to Remove Initial Word from a String Split Function In this method we will split the strings into substring to remove the initial string. We will use the split function for the same purpose. The syntax to be used for removing the initial word from a string using split function is as follows: ... Read More

Advertisements