Answers for "python3 check string for single character"

2

how to check if all characters in string are same python

s == len(s) * s[0]
Posted by: Guest on May-14-2020
1

can you look for specific characters in python

yourString = "string"

if "s" in yourString:
  print("There is an S in your string")
  
if "s" not in yourString:
  print("There is no S in your string")
Posted by: Guest on October-09-2020

Code answers related to "python3 check string for single character"

Python Answers by Framework

Browse Popular Code Answers by Language