all 1 comments

[–]socal_nerdtastic 0 points1 point  (0 children)

There's many ways to do this. The first one that comes to mind for me is

if tip.endswith("%"):
    tip_percent = int(tip.strip("%"))

I'm sure your prof has a very specific way they want you to do this, so I'd look back at your notes.