reset password
Author Message
The Real Bryan
Posts: 12
Posted 17:40 Mar 18, 2019 |

What is up with number 4? Come on, creating those pyramids is just so masochistic to the point it seems legitimately impossible to create them. Anyone possibly has the code or strategy to create those devilish pyramids? The hints did not really help much at all. Much appreciated!

Last edited by The Real Bryan at 20:25 Mar 18, 2019.
The Real Bryan
Posts: 12
Posted 17:44 Mar 18, 2019 |

I also have the code, here it is:

#Part-1

a = "*"
b = 4
c = 3
d = 2
e = 1
f = 0

while(b < 5):
  b = b + 1
  print(a, end="")
  if(b % 5 == 0):
    print()
  while(c < 5):
    c = c + 1
    print(a, end="")
    if(c % 5 == 0):
      print()
    while(d < 5):
      d = d + 1
      if(d % 4 == 0):
        print()
      print(a, end="")
while(e < 5):
  e = e + 1
  print(a, end="")
  if(e % 5 == 0):
    print()
  while(f < 5):
    f = f + 1
    print(a, end="")
    if(f % 3 == 0):
      print()

pretty sure there is a much easier way to create that pyramid with less spam.

albertisawesome
Posts: 3
Posted 10:29 Mar 19, 2019 |

I did mine like this

p = "*"
y = "**"
r = "***"
a = "****"
m = "*****"

while(p != y):
 print(p)
 break
while(y != r):
 print(y)
 break
while(r != a):
 print(r)
 break
while(a != m):
 print(a)
 break
while(m == m):
 print(m)
 break

The Real Bryan
Posts: 12
Posted 15:51 Mar 19, 2019 |

Oh, that's interesting! Thank you for your help!

azecena
Posts: 5
Posted 17:19 Mar 19, 2019 |

can anyone help with number 1, I have all the numbers I'm just having trouble grouping them with the modulus operator.

mgamez
Posts: 2
Posted 17:57 Mar 19, 2019 |

Im so lost on the first one any help 

 

Doggy213
Posts: 11
Posted 18:51 Mar 19, 2019 |

count = 2
while (count <= 20):
  print(count, end=" ")
count = count + 2
print('        ')

x = 1
while (x <= 100):
 print(x, end=" ")
if(x % 5 == 0):
  print()
  x = x + 1
print()
row = 0
x = x + 1
print('      ')

y = 1
while (y <= 100):
 print(y, end=" ")
if(y % 7 == 0):
  print()
  y = y + 1
print()
row = 0
y = y + 1
 

Last edited by Doggy213 at 20:00 Mar 19, 2019.
Jimmy1277
Posts: 3
Posted 22:24 Mar 19, 2019 |

how do you do the second part for it

 

Jimmy1277
Posts: 3
Posted 22:25 Mar 19, 2019 |

number 4 second part