it's not the best way to word the exercise, but yeah if n < 3, then the array to be returned should only have the n number of elements. If the signature = [1,2,3] and n = 2, then the return should be [1,2]
n < 3
n
signature = [1,2,3]
n = 2
[1,2]
That's not what it says:
returns the first n elements - signature included of the so seeded sequence.
With n = 1 you must return the first element of the signature.
the problem said, it should return signature but why the heck they want [1] as return when actually [1,1,1] is given
Because str(num) returns a string, it doesn't change num var value in place.
str(num)
This comment is hidden because it contains spoiler information about the solution
Loading collection data...
it's not the best way to word the exercise, but yeah if
n < 3
, then the array to be returned should only have then
number of elements.If the
signature = [1,2,3]
andn = 2
, then the return should be[1,2]
That's not what it says:
With n = 1 you must return the first element of the signature.
the problem said, it should return signature
but why the heck they want [1] as return when actually [1,1,1] is given
Because
str(num)
returns a string, it doesn't change num var value in place.This comment is hidden because it contains spoiler information about the solution