Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

any function in python

s = input()
    print(any(i.isalnum() for i in s))
    print(any(i.isalpha() for i in s))
    print(any(i.isdigit() for i in s))
    print(any(i.islower() for i in s))
    print(any(i.isupper() for i in s))
Comment

Python any() function

# All elements of list are true
l = [ 4, 5, 1]
print(any( l ))
 
# All elements of list are false
l = [ 0, 0, False]
print(any( l ))
 
# Some elements of list are
# true while others are false
l = [ 1, 0, 6, 7, False]
print(any( l ))
 
# Empty List
l = []
print(any( l ))
Comment

Python any() function

# All elements of tuple are true
t = (2, 4, 6)
print(any(t))
 
# All elements of tuple are false
t = (0, False, False)
print(any(t))
 
# Some elements of tuple are true while
# others are false
t = (5, 0, 3, 1, False)
print(any(t))
 
# Empty tuple
t = ()
print(any(t))
Comment

PREVIOUS NEXT
Code Example
Python :: pandas dataframe convert yes no to 0 1 
Python :: python typing list of possible values 
Python :: prevent selenium from closing 
Python :: reading a list in python 
Python :: python how to add columns to a pandas dataframe 
Python :: remove all parentheses from string python 
Python :: what is iteration in python 
Python :: filter dataframe with a list of index 
Python :: pandas check if column is object type 
Python :: print command python 
Python :: what is python -u 
Python :: plotly subplots 
Python :: Math Module exp() Function in python 
Python :: range() python 
Python :: convert number to reversed array of digits python 
Python :: add data to empty column pandas 
Python :: demonstrating polymorphism in python class 
Python :: python local variables 
Python :: list functions 
Python :: Get the first 4 numbers of the innermost arrays using numpy 
Python :: infinite monkey theorem 
Python :: give cell format to condition pandas dataframe 
Python :: telegram.ext package 
Python :: python status code to string 
Python :: install nsml python 
Python :: dataframe to csv 
Python :: python submatrix 
Python :: seaborn boxplot (both categorical and numeric data) 
Python :: null=true django 
Python :: python tkinter plot points 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =