by pressing the "fork" button below your solution, I was able to make some changes to your solution and share the new solution with you and everybody else :-)
When you call a list it does not have to call individual values. You can call lists or tuples for example. When you do call a tuple within a list you could use times[0] to represent the english value and times [1] to represent the value. Instead python lets you create a shortcut when creating a for loop. When using this nomenclature it automatically sets times[0] to name and times[1] to secs.
So for this problem the for loop will go through 5 iterations. The first time the for loop will set name = 'year' and secs = 365 * 24 * 60 * 60.
Hope this helps.
Traceback (most recent call last):
File "main.py", line 3, in
Test.assert_equals(multiplication_table(2,2), [[1,2],[2,4]])
File "/runner/frameworks/python/cw-2.py", line 34, in assert_equals
expect(actual == expected, message, allow_raise)
File "/runner/frameworks/python/cw-2.py", line 18, in expect
if passed:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Hi,
by pressing the "fork" button below your solution, I was able to make some changes to your solution and share the new solution with you and everybody else :-)
Can you tell me what does fork in codewars mean exactly can you tell?
Nice man. I didn't think like that.
oh yea. I knew this lol. I guess brain stopped haha. Thanks anway dude!
When you call a list it does not have to call individual values. You can call lists or tuples for example. When you do call a tuple within a list you could use times[0] to represent the english value and times [1] to represent the value. Instead python lets you create a shortcut when creating a for loop. When using this nomenclature it automatically sets times[0] to name and times[1] to secs.
So for this problem the for loop will go through 5 iterations. The first time the for loop will set name = 'year' and secs = 365 * 24 * 60 * 60.
Hope this helps.
THANK YOU FOR MAKING THIS!!! REALLY BOOSTED MY CONFIDENCE IN MY SKILLS OF REGEX. TOOK ME A WHILE TO DO THIS!
This comment is hidden because it contains spoiler information about the solution
Closing because this isn't an issue.
Either make the instructions language agnostic or add instructions per language group/conditional comments. See the issue below.
In Python you should return a list, not an array.
please update for pyhton too
This comment is hidden because it contains spoiler information about the solution
Traceback (most recent call last):
File "main.py", line 3, in
Test.assert_equals(multiplication_table(2,2), [[1,2],[2,4]])
File "/runner/frameworks/python/cw-2.py", line 34, in assert_equals
expect(actual == expected, message, allow_raise)
File "/runner/frameworks/python/cw-2.py", line 18, in expect
if passed:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
help im using python