You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
717 B
29 lines
717 B
print("asdf".partition('g'))
|
|
print("asdf".partition('a'))
|
|
print("asdf".partition('s'))
|
|
print("asdf".partition('f'))
|
|
print("asdf".partition('d'))
|
|
print("asdf".partition('asd'))
|
|
print("asdf".partition('sdf'))
|
|
print("asdf".partition('as'))
|
|
print("asdf".partition('df'))
|
|
print("asdf".partition('asdf'))
|
|
print("asdf".partition('asdfa'))
|
|
print("asdf".partition('fasdf'))
|
|
print("asdf".partition('fasdfa'))
|
|
print("abba".partition('a'))
|
|
print("abba".partition('b'))
|
|
|
|
try:
|
|
print("asdf".partition(1))
|
|
except TypeError:
|
|
print("Raised TypeError")
|
|
else:
|
|
print("Did not raise TypeError")
|
|
|
|
try:
|
|
print("asdf".partition(''))
|
|
except ValueError:
|
|
print("Raised ValueError")
|
|
else:
|
|
print("Did not raise ValueError")
|
|
|