last and presses Enter.
class Tool:
def first(self, s):
return s.split()[0]
def last(self, s):
return s.split()[-1]
cmd = input().strip()
t = Tool()
if hasattr(t, cmd):
print(getattr(t, cmd)("big data"))
else:
print("no " + cmd)
What does the program print?Log in to join the discussion.
Loading…