Python Forum
Pattern Require Last Line Print() why?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pattern Require Last Line Print() why?
#1
for x in range(1,6):
    for y in range(5,x,-1):
        print("",end="")
    for z in range(0, x):
        print(x,end="")
    print()
Output:
1 22 333 4444 55555
Problem: This code is mine only.
i am experimenting on patterns of numbers and all i found that if remove the print() word in last line the program does not work! Can Someone tell me print() at last line is neccessary? and if neccessary but why? and explanation?
Reply


Messages In This Thread
Pattern Require Last Line Print() why? - by Harshil - Aug-08-2020, 06:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with spliting line in print akbarza 3 466 Jan-23-2024, 04:11 PM
Last Post: deanhystad
  Why doesn't list require global keyword? johnywhy 9 972 Jan-15-2024, 11:47 PM
Last Post: sgrey
  Print the line before the corrent line tester_V 9 1,649 Nov-18-2022, 08:39 AM
Last Post: Gribouillis
  Print to a New Line when Appending File DaveG 0 1,254 Mar-30-2022, 04:14 AM
Last Post: DaveG
  If match not found print last line tester_V 2 2,940 Apr-26-2021, 05:18 AM
Last Post: tester_V
  print a line break in writelines() method leodavinci1990 1 6,567 Oct-12-2020, 06:36 AM
Last Post: DeaD_EyE
  Print characters in a single line rather than one at a time hhydration 1 2,072 Oct-10-2020, 10:00 PM
Last Post: bowlofred
  How to print string multiple times on new line ace19887 7 5,890 Sep-30-2020, 02:53 PM
Last Post: buran
  Require Some Suggestions gouravlal 2 1,930 Jul-27-2020, 06:14 AM
Last Post: gouravlal
  print only last matched line tester_V 24 6,761 Apr-30-2020, 05:16 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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