+ 3
Very Simple Python Problem - Help?
Hello everyone, Iâm stuck on a string problem in the python for beginners course. It looks like my code output is the same as the desired result but it is incorrect somehow. This is my code: Print (â* \n** \n*** \n****â) My output: * ** *** **** Desired output: * ** *** **** How can I correct my code? Iâve checked to make sure there are no additional spaces as well. Thank you! Ryan
2 Answers
+ 8
Ryan Grant ,
this is the code that is provided from sololearn:
print("* ** *** ****")
most of the users insert new-line sequences '\n', but do not remove the spaces. this creates a problem in the code coach test cases.
so we have to remove ALL spaces in the string!
+ 4
Sometimes sololearn is a little buggy and just running it again makes one pass the test cases. đ€·ââïž
edit:
in your code example, there seem to be white spaces before \n. Did you remove them in your actual code?