pcyuen98 / python-intro

0 stars 0 forks source link

Function no printing accordingly #8

Closed ooi19935566 closed 3 years ago

ooi19935566 commented 3 years ago

Expected result and actual result are different

Code Below :

1 from method import sparePart, printHelloWorld

2 print ('test sparePart method-->', printHelloWorld())

Actual result.

test printHelloWorld method--> hello World test sparePart method--> 2 Enter name:

pcyuen98 commented 3 years ago

For a proper method handling, you need to define in a class.

Example as below https://github.com/pcyuen98/python-intro/blob/main/src/cls/basic_call_method.py

New method_class.py been created to solve this. You may run a git pull