Python Forum
Need help getting the output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help getting the output
#1
S = 5
t=[]
for i in range(1,S+1):
    t.append(i)
for j in range(0,S):
    t[j] = '/'
    print(''.join(str(e) for e in t))
    for i in range(S-1, 0, -1):
        t[i] = t[i-1]
    t[j] = 1
Output:
CODE OUTPUT /2345 1/234 11/23 111/2 1111/
Output:
Expected OUTPUT \2345 1\345 12\45 123\5 1234\
Please help me getting the expected output
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