Found 27104 Articles for Server Side Programming

Interconvert Horizontal and Vertical String using Python

Tapas Kumar Ghosh
Updated on 14-Aug-2023 11:11:13

967 Views

In Python, we have some built−in functions like str(), replace(), split(), strip(), and, len() that will be used to solve Interconvert Horizontal and vertical String. Python allows us to convert strings between horizontal and vertical instructions with simple steps by improving readability, formatting, text manipulation, visual creativity, and programming applications. Syntax The following syntax is used in the examples- str() This is an in−built function in Python that converts the value to a string. It prints the value as a string. replace("", "") The replace is a built−in method in Python that accepts two parameters− and "" ... Read More

Finding the First Even Number in a List using Python

Tapas Kumar Ghosh
Updated on 14-Aug-2023 11:08:07

203 Views

Python has a variety of built-in methods to modify and analyze the text, that contains to find the specific element within them. To solve this problem statement it will use some built-in functions like next(), filter(), and, lambda to find the first even element from the list. The various applications are- data filtering tools, and, content filtering tools. Let’s see how to take the input of the program to get the result: The given list, List_1 = [21, 33, 12, 11, 61, 78] The final result becomes 12 because it is the first even number from the list. Syntax The ... Read More

Find the Common Keys from two Dictionaries in Python

Tapas Kumar Ghosh
Updated on 14-Aug-2023 11:01:20

402 Views

The dictionary is one of the four data types in Python that doesn’t allow any key duplicates. In this problem statement, we have to create two dictionaries as user input and check the matches for a common key. If key elements are found as common then it prints the result. This can be possible by using various methods in Python such as type(), items(), set(), etc. Let’s take an example of this: Input: A = { ‘I’: 10, ‘II’: 20, ‘III’: 30, ‘IV’:40 } B = { ‘II’: 40, ‘V’: 60, ‘VI’: 80, ‘I’: 90 } Output: { ‘I’, ‘II’ ... Read More

Convert Matrix to Custom Tuple Matrix in Python

Tapas Kumar Ghosh
Updated on 14-Aug-2023 10:57:58

273 Views

In Python, a tuple is one of the four built−in data types that is used to collect the data and this data is represented by round parenthesis i.e.(). Tuple is generally known for multiple collections of items into a single item. In Python, we have some built−in functions like map(), tuple(), and, lambda will be used to Convert Matrix to Custom Tuple Matrix. The custom tuple matrix is defined by a subclass of a tuple that has elements and it is separated by a comma to create the sublist(list represents matrix). Let’s take an example of this: Original Matrix: ... Read More

How to Set up Multiple Subplots with Group Legends using Plotly in Python

Tapas Kumar Ghosh
Updated on 14-Aug-2023 10:51:49

682 Views

The multiple subplots are defined by assigning different graph plots. Plotly is a powerful Python library for creating interactive visualizations for data research and presentation. Its capacity to put up multiple subplots, that are independent plots placed within a single figure, is one of its primary characteristics. This feature allows us to compare and display various datasets or variables side by side, giving us a simple overview of the data. In Python, we have some built−in functions− add_trace, update_layout, and, show which can be used to set up multiple subplots with group legends using Plotly in Python. Syntax The ... Read More

Python sorted containers - An Introduction

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:32:27

434 Views

Python offers a wide range of data structures to efficiently organize and manipulate data. When it comes to handling sorted data, sorted containers play a crucial role. Sorted containers are data structures that maintain the elements in a sorted order, providing fast access, insertion, and deletion operations. They offer an effective solution for scenarios where maintaining a sorted order is essential. In this blog post, we will explore the world of Python sorted containers and understand their significance in various applications. We will delve into the different types of sorted containers, such as sorted lists, sorted sets, and sorted dicts, ... Read More

Python Seaborn - Strip plot illustration using Catplot

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:24:15

131 Views

Data visualization plays a crucial role in understanding and communicating patterns, trends, and insights from data. Python, with its rich ecosystem of libraries, offers powerful tools for creating visually appealing and informative plots. Seaborn, a popular data visualization library built on top of Matplotlib, provides a high-level interface for creating beautiful statistical graphics. In this article, we will explore one of Seaborn's versatile plot types - the strip plot. Strip plots are useful for visualizing the distribution of a continuous variable against a categorical variable. They display individual data points along an axis, making it easy to observe patterns, clusters, ... Read More

Python Script to Shutdown Computer

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:22:30

4K+ Views

In today's fast-paced digital world, being able to automate computer tasks can greatly enhance productivity and convenience. One such task is shutting down a computer, which can be time-consuming if done manually. Thankfully, Python provides us with a powerful set of tools to interact with the system and automate such tasks. In this blog post, we will explore how to write a Python script to shut down a computer with ease. Whether you want to schedule automatic shutdowns, initiate a shutdown remotely, or simply save time by avoiding manual shutdowns, this script will come in handy. Importing Required Modules Before ... Read More

Python Script to Restart Computer

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:20:32

2K+ Views

Restarting a computer is a common task that we often perform to troubleshoot issues, install updates, or apply system changes. While there are various ways to restart a computer, using a Python script can provide automation and convenience. In this article, we will explore how to create a Python script that can restart a computer with a simple execution. We will start by discussing the importance of restarting a computer and the benefits it can offer. Then, we will delve into the implementation details of the Python script, explaining the necessary modules and functions involved. Throughout the article, we will ... Read More

Python Script to Shutdown your PC using Voice Commands

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:17:22

219 Views

In today's world of automation and smart devices, voice control has become increasingly popular. From smartphones to virtual assistants, voice commands offer a convenient and hands-free way to interact with technology. What if you could extend this convenience to your PC as well? Imagine being able to shut down your computer with a simple voice command, saving you the trouble of manually navigating through menus or using the mouse. In this blog post, we will explore how to use Python to create a script that allows you to shut down your PC using voice commands. By leveraging the power of ... Read More

Advertisements