2014年2月9日星期日

csc148 SLOG3

    I am now beginning to understand recursion functions. Actually I am doing quite well in this week’s lab. I finished all the tasks in the lab and thought of the optional ones. All I need to improve now is to practice finding the base case for recursion functions. In the lab for example, I did manage to get the code work, and it contains itself as a recursion function, but the base case wasn't separated and instead is aligned with the recursion lines.

    Besides, I am getting used to put adjacent lines into one. For example,
                if x > 1:
                    return True
                else:
                    return False
can be squeezed into one line :
                return True if x>1 else False
That saves a lot of space and is just as easy to read as the longer one.

    
    The problem for me this week is probably understanding assignment 1. And now I am having a hard time with it. I admit I feel a little delighted when seeing the sentence saying that this assignment is challenging. Deadline is approaching. 

没有评论:

发表评论