Input a four digit no. & Swap the first & last digit of no. And second & third digit will remain same | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Input a four digit no. & Swap the first & last digit of no. And second & third digit will remain same

this is not a loop question

22nd Jul 2018, 1:02 PM
Ayush Verma
Ayush Verma - avatar
3 Answers
+ 8
Hello Ayush Verma please be more specific if you have a question about this otherwise it appears to be an assignment which are no longer allowed in Q&A.
22nd Jul 2018, 3:06 PM
bobbie
bobbie - avatar
+ 2
a = input() # make sure user inputs 4 digit no a[0], a[-1] = a[-1], a[0] # no matter what length, it'll swap 1st and last digits
23rd Jul 2018, 3:36 AM
Rugved Modak
Rugved Modak - avatar
0
Then, whats your problem?
22nd Jul 2018, 1:15 PM
KrOW
KrOW - avatar