---
title: "list of string check function in python?"  
description: "list of string check function in python?"  
author: "ICSM Computer"  
published: 2025-09-17  
updated: 2025-11-05  
canonical: https://www.mindstick.com/forum/161916/list-of-string-check-function-in-python  
category: "python"  
tags: ["python-3.4", "Python 3"]  
reading_time: 2 minutes  

---

# list of string check function in python?

**Give me a list of is* [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) with example?**

## Replies

### Reply by Mayank kumar Verma

### Check if a variable is a string

`isinstance(value, str)`

### Check if list contains only strings

`all(isinstance(x, str) for x in lst)`

### Check if list contains any string

`any(isinstance(x, str) for x in lst)`

### Simple function

`def is_list_of_strings(lst):    return all(isinstance(x, str) for x in lst)`

This answer assist by AI

### Reply by Anubhav Sharma

**Predefined** `is*` **string check functions** in Python (the methods of `str` class that return `True`/`False`).

Here’s the full list:

### Common `is*` string methods in Python

| Method | Returns `True` if… |
| --- | --- |
| `str.isalnum()` | All characters are alphanumeric (letters or digits). |
| `str.isalpha()` | All characters are alphabetic (letters only). |
| `str.isascii()` | All characters are ASCII (Python 3.7+). |
| `str.isdecimal()` | All characters are decimal digits (0–9 only). |
| `str.isdigit()` | All characters are digits (includes decimals, subscripts, superscripts). |
| `str.isidentifier()` | String is a valid Python identifier (e.g., variable name). |
| `str.islower()` | All cased characters are lowercase. |
| `str.isnumeric()` | All characters are numeric (includes digits, fractions, Roman numerals, etc.). |
| `str.isprintable()` | All characters are printable or the string is empty. |
| `str.isspace()` | All characters are whitespace. |
| `str.istitle()` | String is title-cased (first letter uppercase, rest lowercase). |
| `str.isupper()` | All cased characters are uppercase. |

### Example usage

```python
s1 = "Python123"
print(s1.isalnum())      # True
print(s1.isalpha())      # False
print(s1.isascii())      # True
print(s1.isdecimal())    # False
print("123".isdecimal()) # True
print("Ⅷ".isnumeric())   # True (Roman numeral)
print("hello".islower()) # True
print("HELLO".isupper()) # True
print("Hello World".istitle()) # True
print("   ".isspace())   # True
print("print".isidentifier())  # True
```


---

Original Source: https://www.mindstick.com/forum/161916/list-of-string-check-function-in-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
