- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10784 Articles for Python
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
137 Views
The task is to create a One-Time Password (OTP) by squaring and concatenating the odd digits of a given number. Input Output Scenarios Following are the input-output scenarios for creating an OTP by squaring and concatenating the odd digits of a number Input number = 123456789 Output OTP: 19254981 The odd digits in the number are 1, 3, 5, 7, 9. Squaring each of these digits gives us 1, 9, 25, 49, 81. Concatenating these squared digits together gives us the OTP 19254981. Input: 54321 Output: 2591 The odd digits in the input number are 5, 3, and ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
133 Views
Creating a list centered on zero involves generating a sequence of numbers where zero is positioned in the middle of the list. While the size of the list can be customized, it is often preferred to use an odd number to ensure symmetrical distribution of elements around zero. In this article, we will discuss the different approaches to creating a list centered on zero using Python programming. Approach We can follow the below steps to create a centered list − Determine the desired size of the list. Let's call this value n. If n is an odd number, it ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
3K+ Views
Strings in Python can contain any sequence of characters, including letters, numbers, symbols, and whitespace. It can represent text, numbers, or any other type of data that can be represented as a sequence of characters. In Python, strings are enclosed in single quotes ('') or double quotes (""). Multiline strings can be created using triple quotes (''' or """). Here are a few examples of valid Python strings: "Hello, World!" "12345" "Python is awesome!" Counting the number of characters in a string involves determining the total count of individual characters within the string. Python offers various techniques for ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
128 Views
A meter is the fundamental unit of length in the International System of Units (SI) and is used worldwide. It is defined as the length of the path traveled by light in a vacuum during a time interval of 1/299, 792, 458 of a second. Meters are commonly used in scientific, engineering, and everyday contexts. The yard, on the other hand, is a unit of length commonly used in both the British imperial and US customary systems of measurement. It is an English unit defined as 3 feet or 36 inches. It is defined as exactly 0.9144 meters. Yards are ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
3K+ Views
When working with text processing and analysis tasks, it is frequently required to count the vowels, lines, and characters in a text file. The goal is to determine the total counts of vowels, lines, and characters present in the file. Python provides various methods and techniques that can be used to accomplish these counting tasks effectively and efficiently. In this article, we will discuss different approaches for counting vowels, lines, and characters in a text file using Python programming. Approach By following the below steps, we can effectively count the vowels, lines, and characters in a text file using Python. ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
4K+ Views
When working with text processing and analysis tasks, it is often necessary to count the words in a text file. The objective is to determine the total number of words present in the file. Python offers several modules and functions that can efficiently and effectively perform word-counting tasks. In this article, we will explore different approaches to obtaining the total word count from a text file using Python programming. Approach Following are the steps to count words in a text file − Open the text file − Use the open() function to open the text file in read mode. ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
934 Views
Blank spaces in a text file refer to the empty spaces or gaps between words, sentences, or characters. These spaces are typically represented by the space character (' ') or other whitespace characters, including tab ('\t'), newline (''), carriage return ('\r'), form feed ('\f'), and vertical tab ('\v'). These characters, as per the Unicode standard, represent empty space or formatting elements in the text. When counting the number of blank spaces in a text file, we are essentially looking for these whitespace characters to determine the frequency or distribution of spaces within the text. This information can be useful for ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
2K+ Views
The Extensible Markup Language (XML) is a widely used format for representing structured information. It is a markup language that allows us to define our own tags to describe the data and its structure. XML is designed to be both human-readable and machine-readable. It uses opening and closing tags to enclose elements, which can have attributes and contain nested elements. The structure of XML documents is defined by a set of rules called Document Type Definition (DTD) or XML Schema. In this article, we will see how to convert XML to a dictionary using Python programming. Input Output Scenarios Following ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
383 Views
In Python, a list is a collection of items or elements that can store multiple values. It is one of the built-in data types in Python and is commonly used for storing and organizing data. A list is represented by square brackets [], and the elements within the list are separated by commas. The elements can be of any data type, including numbers, strings, Booleans, or even other lists. Lists are mutable, meaning you can modify, add, or remove elements from them. Converting a list of integers to a list of strings involves converting each integer element into its string ... Read More
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
4K+ Views
Roman numerals are a numeral system that originated in ancient Rome. They were widely used throughout the Roman Empire and continue to be used in certain contexts today. Roman numerals are based on a combination of letters from the Latin alphabet to represent numeric values. The basic symbols used in Roman numerals are as follows − I: 1 V: 5 X: 10 L: 50 C: 100 D: 500 M: 1000 To form larger numbers, these symbols are combined in various ways. The following rules apply − Symbols are typically written from left to right in descending order of ... Read More