Python Forum
Help needed for a program using loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed for a program using loops
#6
(Sep-10-2023, 06:36 AM)purush167 Wrote: try this code

num = int(input("Please enter number of times: "))

for numb1 in range(1, num):
print ("X" * numb1)

Yes, this works too.
But here I see that the number of times it prints is in the hand of the user. That is also useful

Thanks!
Reply


Messages In This Thread
RE: Help needed for a program using loops - by PythonBoy - Sep-10-2023, 06:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Program that allows to accept only 10 integers but loops if an odd number was entered gachicardo 4 3,718 Feb-24-2022, 10:40 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020