0
Q:

endswith python

str.endswith(suffix[, start[, end]])

text = "Python is easy to learn."
result = text.endswith('to learn') # False
result = text.endswith('to learn.')# True
3
#!/usr/bin/python

str = "this is string example....wow!!!";

suffix = "wow!!!";
print str.endswith(suffix)
print str.endswith(suffix,20)

suffix = "is";
print str.endswith(suffix, 2, 4)
print str.endswith(suffix, 2, 6)
2
str="bruh" #Any String variable
str.endswith(String prefix)
1

New to Communities?

Join the community