+ 1
Why isnât my * triangle code acceptable?
It looks to me like Iâve solved the practice q but itâs not an acceptable answer, so Iâm stuck. Please could someone give me a steer? https://code.sololearn.com/cTZqbc3Xs46x/?ref=app
7 Respostas
+ 3
You should only remove all the spaces.
And i have a newline after the last four stars, i don't know if it will make a difference.
+ 1
Paul, thank you - that worked. I had envisioned a different alignment for the triangle. Making it more complicated than it needed to be!
0
You should use a loop to print the stars as a shape triangle, I think.
Happy coding!
0
Iâm only on Lesson 8.1 and havenât been introduced to loops yet, so I wonder if thereâs another reason?
0
print(" *\n * *\n * * *\n* * * *")
Try this!
0
Sarah von Blumenthal
I see, no problem. Just try to print all lines one by one.
print("*")
print("**")
...
Happy coding!
0
Thanks Vadivelan. Iâm afraid it didnât work.
mesarthim Iâll try that, but the activity tip talked about using spaces and \n