Skip to content
← Back to Community
Birthday blessing
Profile icon
EuniceYeoh

I know very very little of python only, but I’ve made this with python for my friend as a birthday gift. Can anyone tell me how to improve it, either how to use loop to make the code shorter or any new idea I can add in. The words I type inside are in Chinese sorry for any inconvenience but still thank you!

Answered by OldWizard209 [earned 5 cycles]
View Answer
Voters
Profile icon
TurtleAndrew
Comments
hotnewtop
Profile icon
OldWizard209

This is really amazing but very very repetitive. There are ways you can improve this. For example with every for loop, you can just create a function:

def print_out(list_name): for x in list_name : time.sleep(0.3) print(x) print_out(cake2) print_out(cake3) print_out(cake4) ... # so on
Profile icon
EuniceYeoh

@OldWizard209 omg thank you i will do the correction as much as possible. Thank you!!

Profile icon
OldWizard209

Would mind marking my answer as correct? @EuniceYeoh

Profile icon
EuniceYeoh

sure!@OldWizard209

Profile icon
JanaliBopearach
Profile icon
theccmuk

@JanaliBopearach

These courses seem great! Please also check out the courses offered by the Construction Management Institute !

They cover 4 main subject areas:
Claims Consulting
Forensic Scheduling
Construction Management
Risk Management

They are very useful and help you gain further insight in your chosen career path.

Profile icon
btfuss

That's so sweet! Maybe add a rainbow birthday instead of one color.

Profile icon
EuniceYeoh

@btfuss ok i will try to do that as soon as possible thanks!

Profile icon
theccmuk

Online courses have proven to be effective, I can confirm this as I have benefited greatly through learning online.

I took the Claims Consulting Professional course at the Construction Management Institute !

Profile icon
theccmuk