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

arrays_beyza_saridas.py #17

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

Conversation

beyzasaridas
Copy link

No description provided.

Copy link
Owner

@canbula canbula left a comment

Choose a reason for hiding this comment

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

There are certain rules about the function name. Also you need to remove that prints to the standard output. Just keep the function.

Copy link
Owner

@canbula canbula left a comment

Choose a reason for hiding this comment

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

I have added some comments for you to modify your code.

if m < 0:
raise ValueError(" m should be greater than 0")

Random_array = np.random.randint(0, 10 ** d, size=(n, n))
Copy link
Owner

Choose a reason for hiding this comment

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

Follow the conventions for the variable names that we have mentioned in the lab.


Random_array = np.random.randint(0, 10 ** d, size=(n, n))
print("Original Array:")
print(Random_array)
Copy link
Owner

Choose a reason for hiding this comment

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

Remove the lines that you have used print.

Random_array[start_idx:end_idx, start_idx:end_idx] = -1

print("Modified Array:")
print(Random_array)
Copy link
Owner

Choose a reason for hiding this comment

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

Remove the lines that you have used print.

create_modified_array(3, 4, 2)
# Test with m > n
except ValueError as e:
print(f" {e}")
Copy link
Owner

Choose a reason for hiding this comment

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

Remove this try block completely or put this in a if __name__ == "__main__" block to prevent running automatically.

Copy link
Owner

@canbula canbula left a comment

Choose a reason for hiding this comment

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

Remove the lines that are using print.

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

Successfully merging this pull request may close these issues.

2 participants