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

1 drill 0 sum array #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

1 drill 0 sum array #1

wants to merge 7 commits into from

Conversation

Chanya-M
Copy link
Owner

No description provided.

@Chanya-M Chanya-M closed this Feb 25, 2017
@Chanya-M Chanya-M changed the base branch from 1-hr-array-sum to master February 25, 2017 16:12
@Chanya-M Chanya-M reopened this Feb 25, 2017
@Chanya-M
Copy link
Owner Author

@profnandaa, Kindly review my PR

Copy link

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix those.

#!/bin/python3

def array_sum(a):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much unnecessary lines skipped.

arr_sum = 0

for i in arr:
arr_sum += i

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be tabbed, and the variable here is a not arr:

for i in a:
    arr_sum += i

Most likely you didn't test your code.

@Chanya-M
Copy link
Owner Author

@profnandaa , I saw my mistakes. I have fixed my code.

@Chanya-M
Copy link
Owner Author

code
There is a tab in my code (the for-loop) but when I commit it, it disappears.

@robercicksimiyu
Copy link

@Chanya-M To convert the tabs to spaces, at the bottom right corner, click on the {spaces 4}. In the options you should click on Convert Indentation to spaces and you will be good to go.

@Chanya-M
Copy link
Owner Author

@robercicksimiyu Thanks. Let me do that.

@Chanya-M
Copy link
Owner Author

It is still not working after doing that.

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