Skip to content

Commit ee798f9

Browse files
authored
Calculate how many tacos to order based on RSVPs. (GH-1)
Calculate how many tacos to order based on RSVPs. Assume only 65% of RSVPs will show up. 3 tacos per person: - 60% meat tacos - 40% veg tacos 6 tortillas per person.
1 parent c5f7f5c commit ee798f9

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
__pycache__/
3+
dist/
4+
venv/

flit.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[metadata]
2+
module = pytaco
3+
author = Mariatta Wijaya
4+
author-email = [email protected]
5+
maintainer = Mariatta Wijaya
6+
maintainer-email = [email protected]
7+
home-page = https://github.com/Mariatta/taco-py
8+
description-file = README.rst
9+
classifiers = Programming Language :: Python :: 3.6
10+
Intended Audience :: Developers
11+
License :: OSI Approved :: Apache Software License
12+
requires-python = >=3.6
13+
14+
[scripts]
15+
pytaco = pytaco:main

pytaco.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""How many tacos for a meetup?"""
4+
5+
__version__ = "1.0.0"
6+
7+
8+
def main():
9+
rsvps = int(input("How many RSVPs? ") or 0)
10+
11+
# Meetup Universal Constant)
12+
muc = 65
13+
14+
muc_str = input(f"What percentage will show up? [{muc}] ")
15+
if muc_str.strip():
16+
muc = int(muc_str.strip())
17+
18+
attending = int(rsvps * muc / 100)
19+
20+
print()
21+
print(f"👪 {attending} people will show up (guess)")
22+
23+
# 3 tacos per person
24+
# 60% meat taco
25+
# 40% veg taco
26+
# 6 tortillas per person
27+
28+
total_taco = attending * 3
29+
meat_taco = 0.6 * total_taco
30+
veg_taco = 0.4 * total_taco
31+
32+
tortillas = attending * 6
33+
34+
print()
35+
print(f"{meat_taco:.0f} 🍖 🌮 meat tacos")
36+
print(f"{veg_taco:.0f} 🥒 🌮 veg tacos")
37+
print()
38+
print(f"{total_taco:.0f} 🌮 total tacos")
39+
print()
40+
print(f'{tortillas} 4" tortillas')
41+
42+
if __name__ == '__main__':
43+
main()

0 commit comments

Comments
 (0)