Python Forum
Need help getting the output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help getting the output
#4
@perfringo: First of all , input has to be integer, not tuple , list will not support replace.

@ichabod801 : Thanks for your suggestion , but here is what the output comes

S = 5
H = 1
t=[]
for i in range(1,S+1):
    t.append(i)
for j in range(0,S):
    print(''.join(str(e) for e in t))
    t[j] = ('\\')
    for i in range(S-1, 0, -1):
        t[i] = t[i-1]
    t[j] = 1



Output:
Not the expected output and i am struggling to replace number to \ after each loop 12345 1\234 11\23 111\2 1111\
Reply


Messages In This Thread
Need help getting the output - by aankrose - Apr-10-2019, 04:41 PM
RE: Need help getting the output - by ichabod801 - Apr-10-2019, 05:51 PM
RE: Need help getting the output - by perfringo - Apr-10-2019, 07:12 PM
RE: Need help getting the output - by aankrose - Apr-10-2019, 09:02 PM
RE: Need help getting the output - by perfringo - Apr-11-2019, 04:12 AM
RE: Need help getting the output - by Yoriz - Apr-10-2019, 10:12 PM
RE: Need help getting the output - by ichabod801 - Apr-11-2019, 02:09 AM
RE: Need help getting the output - by aankrose - Apr-11-2019, 05:10 PM
RE: Need help getting the output - by loomski - Apr-11-2019, 07:52 PM
RE: Need help getting the output - by aankrose - Apr-12-2019, 02:35 AM
RE: Need help getting the output - by perfringo - Apr-11-2019, 09:01 PM

Forum Jump:

User Panel Messages

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