- 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
Rajendra Dharmkar has Published 496 Articles

Rajendra Dharmkar
357 Views
In Python, a string is a sequence of characters. It's a type of data that represents text values, such as words, sentences, or even entire documents. Strings in Python are enclosed in either single quotes ('...') or double quotes ("..."), and can include alphanumeric characters, symbols, whitespace, and more. ... Read More

Rajendra Dharmkar
492 Views
To check if a string or a substring of a string ends with a suffix in Python, there are several ways to accomplish this. Here are some examples: Using the endswith() Method The endswith() method checks if the string ends with a specified suffix and returns a boolean value. To ... Read More

Rajendra Dharmkar
113 Views
A substring is a contiguous sequence of characters within a string. In other words, it's a smaller piece of text that appears within a larger piece of text. For example, in the string "lorem ipsum", the substring "lorem" appears within the larger string. Similarly, the substring "em i" appears within ... Read More

Rajendra Dharmkar
323 Views
ASCII stands for American Standard Code for Information Interchange. ASCII is a character encoding system that assigns a unique number to each letter, digit, and symbol on a standard keyboard. In Python, each character has a numerical value based on the ASCII code, which can be checked using the ord() ... Read More

Rajendra Dharmkar
6K+ Views
To check if a Python string contains only digits, we can use the built-in isdigit() method. This method returns True if all the characters in the string are digits, and False otherwise. Here's an example code snippet that demonstrates how to use isdigit(): To check if a string contains only ... Read More

Rajendra Dharmkar
2K+ Views
Here are three code examples that demonstrate how to check if a character in a string is a letter in Python: Using the isalpha() method The isalpha() method is a built-in method in Python that returns True if all the characters in a string are alphabets (letters) and False otherwise. ... Read More

Rajendra Dharmkar
92 Views
Capitalizing a string in Python is a common task and can be done using methods like upper(), capitalize() and others. Here are some examples of how to use it: Capitalize all the letters in a string Example In this example, we define a string "lorem ipsum" and use the upper() ... Read More

Rajendra Dharmkar
874 Views
To wrap a string in a file in Python, you can follow these steps: Open a file in write mode using the open() function and assign it to a variable. Call the write() function on the file variable and pass the string you want to wrap as an argument. This ... Read More

Rajendra Dharmkar
205 Views
Python modules are essentially just files containing Python code that can be imported and used in other Python programs. Here's an explanation with some code examples: Basic Module Example Let's create a simple module called my_module.py. We can define a function in this module called hello() which prints a ... Read More

Rajendra Dharmkar
198 Views
In Python 3, the input() function always returns a string, even if the user enters a number. To check if the user input is an integer, you can use a try-except block and attempt to convert the input string to an integer using the int() function. Here are some code ... Read More