“Como verificar se uma string termina com uma substring python” Respostas de código

Como verificar se uma string termina com uma substring python

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

Como verificar se a string termina com caracteres específicos em Python

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

Respostas semelhantes a “Como verificar se uma string termina com uma substring python”

Perguntas semelhantes a “Como verificar se uma string termina com uma substring python”

Mais respostas relacionadas para “Como verificar se uma string termina com uma substring python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código