Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python count how many times a character appears in a string

str = "Hello world".lower()

result = str.count('world')
print(result)
#the ouput will be 1 because in the variable "str" the letter "world" appers only one time :)
 
PREVIOUS NEXT
Tagged: #python #count #times #character #appears #string
ADD COMMENT
Topic
Name
7+2 =