
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sarika Singh has Published 189 Articles

Sarika Singh
5K+ Views
To check if a string contains at least one letter and one number in Python, you can - Use any() function with str.isalpha() function and str.isdigit() function to go through characters. Use re.search() function with appropriate regular expressions for pattern matching. Both methods are commonly used for ... Read More

Sarika Singh
13K+ Views
To verify that a string contains only letters, numbers, underscores, and dashes in Python - Use re.fullmatch() function with a pattern like [A-Za-z0-9_-]+ for regex-based checking. Use set comparison with all() function for simple logic-based validation. Many systems restrict input to certain characters for security or formatting reasons. ... Read More

Sarika Singh
6K+ Views
In this article, we focus on how to check if a string is alphanumeric using regular expressions in Python. Regular expressions are very useful for pattern matching and validation. To use them, first import the re library, which is included by default in Python. The regular expression ^[a-zA-Z0-9]+$ matches strings ... Read More

Sarika Singh
9K+ Views
To check if a Python string contains only certain characters, you can use - set Comparison Regular Expressions Character Lists These approaches help you to verify whether every character in the string belongs to a defined set of allowed characters or not. Using Set Comparison You can create ... Read More

Sarika Singh
877 Views
In Python, Unicode strings can contain numeric characters from various languages and scripts. To check if a Unicode string contains only numeric characters, we can use built-in string methods, regular expressions, or character iteration. These methods ensure that characters like Arabic numerals, Chinese digits, or superscripts are also recognized ... Read More

Sarika Singh
4K+ Views
In Python, you can customize many operations like accessing or modifying elements of a list or dictionary using special methods. Two important methods that make your objects behave like lists or dictionaries are: __getitem__: called when you access an item using obj[key]. __setitem__: called when you assign a value ... Read More

Sarika Singh
4K+ Views
In Python, you can check whether a string contains letters, numbers, or both using built-in string methods such as isalpha(), isdigit(), and isalnum(). You can also use loops or regular expressions for more customized checks. Checking for Only Alphabets The isalpha() method returns True if every character in the string ... Read More

Sarika Singh
12K+ Views
To check if a Python string contains only digits, you can use the built-in isdigit() method. This method returns True if all characters in the string are digits, and False otherwise. Besides isdigit(), you can also use loops or regular expressions to verify this condition. Using the isdigit() Method The ... Read More

Sarika Singh
2K+ Views
In Python, you can easily check whether a string or a substring ends with a specific suffix using the built-in endswith() method. This method returns True if the string ends with the specified suffix, otherwise it returns False. This method also allows to check multiple suffixes at once and can ... Read More

Sarika Singh
1K+ Views
In Python, arguments are passed to functions using call by object reference or call by sharing. This means that when you pass a variable to a function, you are actually passing a reference to the object in memory, not a separate copy. For mutable objects like lists and dictionaries, ... Read More