Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
How to change a vector only numbers with have multiple of x #3844
Conversation
Travis tests have failedHey @thiagomonteles, TravisBuddy Request Identifier: ab7c4bf0-1afd-11eb-ae51-b75871e10011 |
Travis tests have failedHey @thiagomonteles, TravisBuddy Request Identifier: 0f85e2a0-1afe-11eb-ae51-b75871e10011 |
|
Here is why pre-commit failed:
Because of this, Travis also failed. |
| You need create a function that check if an element X in a vector(list) is divisible for another number Y | ||
| ''' | ||
|
|
||
| def change_multiple(change_to,multiple,vector): |
| ''' | ||
|
|
||
| def change_multiple(change_to,multiple,vector): | ||
| for i in range(len(vector)): # scroll through the list |
mrmaxguns
Nov 4, 2020
Contributor
No need to use range(len(...)) as we have enumerate:
for i, value in enumerate(vector):
if value % multiple == 0:
value = change_to
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.