Last active
August 30, 2019 19:44
-
-
Save Shaddyjr/8c1e2f78b22da2261bb0a01e4b05c361 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def movie(card, ticket, perc): | |
ticket_num = 0 | |
sys_a = 0 | |
sys_b = 500 | |
sys_b_prev = ticket | |
while math.ceil(sys_b) > sys_a: | |
sys_a += ticket | |
sys_b_prev *= perc | |
sys_b += sys_b_prev | |
ticket_num += 1 | |
return ticket_num |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment