F
F
FenTCouts2022-01-14 06:48:36
Python
FenTCouts, 2022-01-14 06:48:36

How to replace a character in the last line of output?

When executing the code the result is:

Accounts:
├ @invaiderd
├ @xeokls
├ @JEy9key


or

Accounts:
├ @JEy9key


Is it possible to replace the last result with └ ?
What would happen like this:

Accounts:
├ @invaiderd
├ @xeokls
└ @JEy9key


or

Accounts:
└ @JEy9key

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Mandzyuk, 2022-01-14
@Ryslan_13

Accounts = '@invaiderd','@xeokls','@JEy9key'
Accounts_len =  len(Accounts) - 1

x = '	├'
y = '	└'
print('Accounts:')
for item in Accounts:
  print(x,item)
  if item == Accounts[Accounts_len]:
    print(y,item)
    break

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question