Skip to content

Instantly share code, notes, and snippets.

@claudchereji
Created May 31, 2020 05:32
Show Gist options
  • Save claudchereji/423676a1fc9365d4a843e9a592e74c15 to your computer and use it in GitHub Desktop.
Save claudchereji/423676a1fc9365d4a843e9a592e74c15 to your computer and use it in GitHub Desktop.
tip_calc.py
import appex, ui
import console
import os
label = ui.Label(font=('Menlo', 24), alignment=ui.ALIGN_CENTER)
label.text = 'Tip Calc: '
appex.set_widget_view(label)
meal_price = eval(input('How much did you pay for the meal? '))
tip = eval(input('What tip percentage would you like to leave? (15%, 20%, 30%)'))
f_tip = tip/100
mealntip = meal_price*f_tip
print('Your tip is ', mealntip , 'and your total will be ', meal_price+mealntip)
@claudchereji
Copy link
Author

Supposed to be a tip calculator widget. But... it doesn't work. Gonna figure it out though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment