-2

Let's say I have an input:

SA3213023215 

I want to move the SA to the very end of the input.
How can I do this?

6
  • 1
    " i already tried so much" <- please show us Commented Nov 1, 2018 at 17:37
  • 1
    Possible duplicate of Is there a way to substring a string in Python? and maybe Ways to slice a string? or How to move the first letter of a word to the end. So many to choose from. Commented Nov 1, 2018 at 17:38
  • Do you always have the input beginning with two characters (like SA) or does it vary? Commented Nov 1, 2018 at 17:39
  • the input does always have the two characters at the beginning. i tried it with extend, append range and all but it didnt work. Commented Nov 1, 2018 at 17:41
  • like this IBAN = input("Bitte geben sie ihre IBAN ein:") IBAN.append(IBAN in range(0,1)) print(IBAN) Commented Nov 1, 2018 at 17:42

1 Answer 1

3

Assuming that SA3213023215 is a string (which input is by default), you could use string slicing:

s = "SA3213023215" s2 = s[2:] + s[:2] # yields 3213023215SA 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.