Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions/return val (Lesson 7 Task 3) exercise is not to the point #20

Open
dz0 opened this issue Dec 23, 2016 · 1 comment
Open

Functions/return val (Lesson 7 Task 3) exercise is not to the point #20

dz0 opened this issue Dec 23, 2016 · 1 comment
Assignees

Comments

@dz0
Copy link

dz0 commented Dec 23, 2016

The exercise expects one to understand fib sequence generation algorithm, but not the function "return" mechanism...

I'd propose to take some other example:

def sign(x):
   """ function returns the sign of number: 1 if positive, -1 if negative, or 0
        ps.: return exits fuction, so no further actions happen after it occurs
   """
    if x > 0:
        return 1     # placeholder "return 1"
    if x < 0:      
        return -1    # placeholder "return"
    return 0   #  placeholder "0"

https://github.com/JetBrains/pycharm-courses/blob/master/introduction_course_v2/lesson7/task3/return_keyword.py

@dz0 dz0 changed the title Functions/return val (Lesson 7 Task 3) iexercise is not to the point Functions/return val (Lesson 7 Task 3) exercise is not to the point Dec 23, 2016
@ktisha
Copy link
Contributor

ktisha commented Jan 9, 2017

@dz0 I really like the idea! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants