Learn Python in 100 days thread

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,540
Daps
131,998

Mike809

Veteran
Supporter
Joined
Oct 15, 2015
Messages
16,693
Reputation
4,209
Daps
85,690
Reppin
Bronx
GitHub - SnowflakesByTheOZ/Day-15---Coffee-Machine: Coffee machine exercise

What's up, hope yall been good. This is my attempt at Day 15's Coffee Machine exercise. I am a beginner so please highlight any errors I made or indicate areas that I could've improved.

Peace to yall
You have self-repeating code which is what functions are for. Most of the changes in your code seem to be price and order name so just make a function that takes those two as
arguments. You can use something like print(f'not enough funds to purchase {order_name}')

that was just a quick glance as ur code, you can probably notice other things that you can turn into functions.
 

Ski Mask

Friendzone: Collection 1
Joined
Jan 10, 2013
Messages
5,342
Reputation
2,037
Daps
21,460
Reppin
Vegas/seattle
Got this while it was on sale along with the web development course(which im taking now). I should be able to start this by january if my adhd doesn't keep me from finishing my first course on time.
 

Secure Da Bag

Veteran
Joined
Dec 20, 2017
Messages
42,085
Reputation
21,706
Daps
131,179
GitHub - SnowflakesByTheOZ/Day-15---Coffee-Machine: Coffee machine exercise

What's up, hope yall been good. This is my attempt at Day 15's Coffee Machine exercise. I am a beginner so please highlight any errors I made or indicate areas that I could've improved.

Peace to yall

You have self-repeating code which is what functions are for. Most of the changes in your code seem to be price and order name so just make a function that takes those two as
arguments. You can use something like print(f'not enough funds to purchase {order_name}')

that was just a quick glance as ur code, you can probably notice other things that you can turn into functions.

That's the only critique. You should use functions more. Otherwise looks good.
 
Top