How to sense if typed characters in python

Code examples

1
0

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")
1
0

how to search for a specific character in a part of a python string

myString = "God is good"

if "o" in myString[0:4]
	print("Working! There is an 'O' in between the G and D of God.")

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................