“Comment vérifier si une chaîne se termine par un python de substring” Réponses codées

Comment vérifier si une chaîne se termine par un python de substring

inp = input("Enter file name: ")
if inp.endswith(".py"):
  print("Your file is a python file!")

# There are two examples here
# if the input ends with .py then inp.endswith(".py") will output True
# and prints "Your file is a python file!" in this example
# if it doesnt end with .py then it will output False
Funyn Kayvanhs Khiatan

Comment vérifier si String se termine par des caractères spécifiques dans Python

Text = "python is easy"
print(Text.endswith("easy"))
Programmer of empires

Réponses similaires à “Comment vérifier si une chaîne se termine par un python de substring”

Questions similaires à “Comment vérifier si une chaîne se termine par un python de substring”

Plus de réponses similaires à “Comment vérifier si une chaîne se termine par un python de substring” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code