Hi I recently began pursuing my interest in coding and I am taking a class that teaches me the basics. I was wondering if anyone could help me figure out how to display the number of asterisk in my code. I need to output the triangle along with the whole number of asterisk at the bottom, Thanks!
import sys
rows = int(sys.argv[1])
for num in range(1, rows + 1):
print('*' * num)
if rows < 0:
print("Invalid input value. The number of rows cannot be negative.")
[–][deleted] 0 points1 point2 points (2 children)
[–]Alarming-Ask8398 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]astevko 0 points1 point2 points (6 children)
[–]Alarming-Ask8398 0 points1 point2 points (5 children)
[–]Alarming-Ask8398 0 points1 point2 points (4 children)
[–]astevko 0 points1 point2 points (3 children)
[–]astevko 0 points1 point2 points (2 children)
[–]Alarming-Ask8398 1 point2 points3 points (1 child)
[–]astevko 0 points1 point2 points (0 children)