Skip to content

Commit 0012506

Browse files
committed
updated readme and created files
1 parent 6259ca7 commit 0012506

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+24
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion

python/list-1/common_end.py

Whitespace-only changes.

python/list-1/first_last6.py

Whitespace-only changes.

python/list-1/has23.py

Whitespace-only changes.

python/list-1/make_ends.py

Whitespace-only changes.

python/list-1/make_pi.py

Whitespace-only changes.

python/list-1/max_end3.py

Whitespace-only changes.

python/list-1/middle_way.py

Whitespace-only changes.

python/list-1/reverse3.py

Whitespace-only changes.

python/list-1/rotate_left3.py

Whitespace-only changes.

python/list-1/same_first_last.py

Whitespace-only changes.

python/list-1/sum2.py

Whitespace-only changes.

python/list-1/sum3.py

Whitespace-only changes.

python/list-2/big_diff.py

Whitespace-only changes.

python/list-2/centered_average.py

Whitespace-only changes.

python/list-2/count_evens.py

Whitespace-only changes.

python/list-2/has22.py

Whitespace-only changes.

python/list-2/sum13.py

Whitespace-only changes.

python/list-2/sum67.py

Whitespace-only changes.

python/logic-1/alarm_clock.py

Whitespace-only changes.

python/logic-1/caught_speeding.py

Whitespace-only changes.

python/logic-1/cigar_party.py

Whitespace-only changes.

python/logic-1/date_fashion.py

Whitespace-only changes.

python/logic-1/in1to10.py

Whitespace-only changes.

python/logic-1/love6.py

Whitespace-only changes.

python/logic-1/near_ten.py

Whitespace-only changes.

python/logic-1/sorta_sum.py

Whitespace-only changes.

python/logic-1/squirrel_play.py

Whitespace-only changes.

python/logic-2/close_far.py

Whitespace-only changes.

python/logic-2/lone_sum.py

Whitespace-only changes.

python/logic-2/lucky_sum.py

Whitespace-only changes.

python/logic-2/make_bricks.py

Whitespace-only changes.

python/logic-2/make_chocolate.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
We want make a package of goal kilos of chocolate. We have small bars (1 kilo each)
3+
and big bars (5 kilos each). Return the number of small bars to use, assuming we
4+
always use big bars before small bars. Return -1 if it can't be done.
5+
"""
6+
7+
def make_chocolate(small, big, goal):
8+
9+
# check if enough chocolate in the first place
10+
11+
if goal > big * 5 + small or goal % 5 > small:
12+
return -1
13+
14+
# if enough, figure out how many big is needed then small
15+
16+
elif goal // 5 > big:
17+
return goal - big * 5
18+
19+
return goal - (goal // 5) * 5

python/logic-2/no_teen_sum.py

Whitespace-only changes.

python/logic-2/round_sum.py

Whitespace-only changes.

python/string-1/combo_string.py

Whitespace-only changes.

python/string-1/extra_end.py

Whitespace-only changes.

python/string-1/first_half.py

Whitespace-only changes.

python/string-1/first_two.py

Whitespace-only changes.

python/string-1/hello_name.py

Whitespace-only changes.

python/string-1/left2.py

Whitespace-only changes.

python/string-1/make_abba.py

Whitespace-only changes.

python/string-1/make_out_word.py

Whitespace-only changes.

python/string-1/make_tags.py

Whitespace-only changes.

python/string-1/non_start.py

Whitespace-only changes.

python/string-1/without_end.py

Whitespace-only changes.

python/string-2/cat_dog.py

Whitespace-only changes.

python/string-2/count_code.py

Whitespace-only changes.

python/string-2/count_hi.py

Whitespace-only changes.

python/string-2/double_char.py

Whitespace-only changes.

python/string-2/end_other.py

Whitespace-only changes.

python/string-2/xyz_there.py

Whitespace-only changes.

python/warmup-1/diff21.py

Whitespace-only changes.

python/warmup-1/front3.py

Whitespace-only changes.

python/warmup-1/front_back.py

Whitespace-only changes.

python/warmup-1/makes10.py

Whitespace-only changes.

python/warmup-1/missing_char.py

Whitespace-only changes.

python/warmup-1/monkey_trouble.py

Whitespace-only changes.

python/warmup-1/near_hundred.py

Whitespace-only changes.

python/warmup-1/not_string.py

Whitespace-only changes.

python/warmup-1/parrot_trouble.py

Whitespace-only changes.

python/warmup-1/pos_neg.py

Whitespace-only changes.

python/warmup-1/sleep_in.py

Whitespace-only changes.

python/warmup-1/sum_double.py

Whitespace-only changes.

python/warmup-2/array123.py

Whitespace-only changes.

python/warmup-2/array_count9.py

Whitespace-only changes.

python/warmup-2/array_front9.py

Whitespace-only changes.

python/warmup-2/front_times.py

Whitespace-only changes.

python/warmup-2/last2.py

Whitespace-only changes.

python/warmup-2/string_bits.py

Whitespace-only changes.

python/warmup-2/string_match.py

Whitespace-only changes.

python/warmup-2/string_splosion.py

Whitespace-only changes.

python/warmup-2/string_times.py

Whitespace-only changes.

0 commit comments

Comments
 (0)