Learn Python in 100 days thread

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,252
Daps
131,941

Mike809

Veteran
Supporter
Joined
Oct 15, 2015
Messages
16,101
Reputation
3,651
Daps
82,108
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,087
Reputation
1,685
Daps
20,306
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
40,039
Reputation
20,339
Daps
126,176
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