Fix the code to output a triangle of stars that has 4 rows. | Sololearn: Learn to code for FREE!

-3

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

Urgent solution wanted

12/8/2021 7:30:34 PM

Mahek Nath

+11

Mahek Nath , please don't ask the community to do this job for you. to get ready codes does not really help you to progress in learning and it does not develop your problem solving ability. if you really have a problem, we need some more details from you: => please put your code in playground, save it there and post a link to it here. thanks for your understanding!

+4

lol Cool Code

+4

+3

If i remember well, just remove the spaces.

+3

Paul Yes u were right

+3

shaffi dudekula from math import sqrt a=float(input()) print(sqrt(a)) Or just do this: a=float(input()) print(a**(1/2))

+2

+2

+2

a,d=int(input('enter the row: \n')),[] x=a-1 for i in range(a): d.append(i+1) print((x-i)*' '+d[i]*'* ')

+2

Amirreza Hashemi , Add "\n" newline a,d=int(input('enter the row: \n')),[]

+2

Yeah buddy. Lightweight baby. Okay add a new line make it More beautiful lol

+2

SoloProg yeah buddy. Added a new line just bc u said. Haha

+2

Yep I did it by myself after some try Thanks for ur answers

+2

Lisa It was urgent bc I wanted to complete my daily goal

+2

How to find square root of a number in python code

+2

shaffi dudekula by raising it by the power of 0.5 or by using the sqrt() function from math module. If you have a question, try to google it and if don't find an answer, please create an own thread instead of posting in an completely unrelated thread.

+1

Triangle of stars https://code.sololearn.com/cLFpnJLb7cES

+1

Check my code u can get there in cpp. Logic will be the same change the syntax only