how to print in python | SoloLearn: Learn to code for FREE!

+1

# how to print in python

how to print this using nested loops? ๐ * ** *** **** ***** **** *** ** *

5/9/2021 5:15:05 PM

Hosein

+7

Frogged kannst Du gerne haben: [๐๐๐๐๐((5-๐๐๐(๐))*'*') ๐๐๐ ๐ ๐๐ ๐๐๐๐๐(-4,5)]

+4

Wow, Jan Markus. Nice one-liner used ๐คฉ๐คฉ

+4

AKSHAY๐ฎ๐ณ [INACTIVE] Android App: "Stylish Text" Font number: 116 On Windows-Systems it is often called "Courier". In the Android-app the fonts have no names.

+3

Jan Markus nice... But his teacher will smell the Braten and then...๐ค๐ค๐ค Trotzdem....wirklich hübsch.

+3

Finally....one loop for each row and the nested one for the cols like Adam Riese would have told us if he was born a bit later. Concerning the ranges ....Jan Markus did the work for u.

+3

This is solved using nested loops. Try to think for the logic before solving the question. https://code.sololearn.com/cvBhhg516Ihy/?ref=app

+2

+2

I can do it even without nested loops within an oneliner. ๐ค Or does your teacher insist on using nested loops?

+2

Try it like this: n = 5 for i in range (1, n + 1): for j in range (1, i + 1): print ('*', end = '') print() for i in range (n, 0, -1): for j in range (1, i + 1): print ('*', end = '') print()

+1

Jan Markus which font did you used to write code??

0

Jan Markus zeig mal den oneliner...

0

hi for ๐ in ๐๐๐๐๐(-4,5): if i<0: print((5-(-1*๐))*'*') else: print((5-(๐))*'*')