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
#2
A range of 1 will only loop once with a value of 0.
0*"*" won't print anything
n = n+1 does nothing to alter your print statement as it is only using x
range can have its first parameter as the start and the second as the end, try playing around with using range(start_value, end_value) (not end value is not inclusive) to get the output you desire.
Note: the line n = n+1 can be removed.
PythonBoy likes this post
Reply


Messages In This Thread
RE: Help needed for a program using loops - by Yoriz - Sep-03-2023, 12:50 PM

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,756 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