2014-01-22 23:20:40 +00:00
|
|
|
print("foobar".startswith("foo"))
|
|
|
|
print("foobar".startswith("Foo"))
|
|
|
|
print("foobar".startswith("foo1"))
|
|
|
|
print("foobar".startswith("foobar"))
|
|
|
|
print("foobar".startswith(""))
|
2014-05-15 19:18:34 +01:00
|
|
|
|
|
|
|
print("1foobar".startswith("foo", 1))
|
|
|
|
print("1foo".startswith("foo", 1))
|
|
|
|
print("1foo".startswith("1foo", 1))
|
|
|
|
print("1fo".startswith("foo", 1))
|
|
|
|
print("1fo".startswith("foo", 10))
|
2017-08-28 22:06:21 +01:00
|
|
|
|
|
|
|
try:
|
|
|
|
"foobar".startswith(1)
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|