Working on mario (more).py port into python. My code works and it seems to output the correct things, but check50 does not like it. Can anyone point me in the right direction of where I am incorrect?
1 Answer
Hint: How many spaces should be between the two half-pyramids? (check50
's output won't show you how many you print or are supposed to print, it always shows one)
You should really look into the *
operator for lists and strings. For example, "123" * 3
would result in the string "123123123"
. [42] * 4
would result in a list [42, 42, 42, 42]
.
That way, and with string concatenation operator +
, you can have a single print statement in your for loop, and no inner loops.
-
According to the specification, there should be two spaces between the two half-pyramids, which is what I tried to do in my code Dec 12, 2017 at 17:38
-
{}
button in the editor or pressCtrl
+K
. Indentation is very important in Python, and code with incorrect indentation could mean anything.