I'm so bad at math | Sololearn: Learn to code for FREE!

+3

I'm so bad at math

Fix the code to output a triangle of stars that has 4 rows

9/18/2021 8:43:01 AM

Patrick Fernandez

23 Answers

New Answer

+10

So...and that was math?

+9

Patrick Fernandez "Why do we need to remove those spaces" Spaces to the human mind is a gap between text that allows us to identify words in a sentence. So we tend to ignore it. But a space to a computer is a text character, just as important as a letter, number or punctuation mark. Just because we can't see it does not mean it doesn't exist. Let me attach a little code which may help you understand further https://code.sololearn.com/cR8q6PcSDb0A/?ref=app

+5

Oma Falk , may be anything which looks difficult to them , they like to call them maths ๐Ÿ˜‚๐Ÿคฃ

+2

Patrick Fernandez , please post the task description and the code you have done so far. thanks!

+2

Remove the extra spaces. And your code outputs 5 lines.

+2

Anything can be improved through practice

+2

I'm bad at math too so ur good!! XD

+1

Just for passing the sololearn test.

0

This code tries to make a triangle out of stars. But oh no! Thereโ€™s an error in there somewhere - it outputs all the stars on one line, instead of separate lines. Fix the code to output a triangle of stars that has 4 rows. Sol. Print("* \n** n\*** n\**** n\****")

0

I mean Print("* \n** \n*** \n**** \n*****")

0

And my answer is wrong

0

I've got the answer sir thank you. Btw why do we need to remove those spaces sir?

0

0

Thanks man ๐Ÿ‘Œ

0

Try and learn code anytime, anywhere

0

Patrick Fernandez print(" * \n *** \n ***** \n******* "); U can try this. And also try this to get triangle. https://code.sololearn.com/cj7vngi7L13Q/?ref=app

0

For any size of rows, you need to start from 1 and add one * to reach the defined size.

0

for _ in range(1, 5): print('*'*_)

0

for counter in range(1:row_numbers+1): stars = counter for star in range(stars): print(* +'\n') Like this if I'm not mistaken

0

kiarash Yavari not efficent