Remove the spaces in String python

python program to get a String and remove the spaces

Sample Input 1:

Hello World
Sample  Output 1 :

HelloWorld

Program or Solution

				
			
					
s1=input("Enter a String:")
s2=""
for i in s1:
    if(i!=" "):
        s2+=i
s1=s2
print(s1)


			
				
			

Program Explanation

visit each location in string s1, if charcter in the location is not a space then append it in s2, finally store s2 in s1. Note: String is immutable, so you cannot modify a character directly in a orginal string.

Comments

ubaTaeCJ
-1 OR 2+465-465-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3+465-465-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3*2<(0+5+465-465) --
ubaTaeCJ
-1 OR 3*2>(0+5+465-465) --
ubaTaeCJ
-1 OR 2+991-991-1=0+0+0+1
ubaTaeCJ
-1 OR 3+991-991-1=0+0+0+1
ubaTaeCJ
-1 OR 3*2<(0+5+991-991)
ubaTaeCJ
-1 OR 3*2>(0+5+991-991)
ubaTaeCJ
-1' OR 2+897-897-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3+897-897-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3*2<(0+5+897-897) --
ubaTaeCJ
-1' OR 3*2>(0+5+897-897) --
ubaTaeCJ
-1' OR 2+755-755-1=0+0+0+1 or 'Hz8lCbzi'='
ubaTaeCJ
-1' OR 3+755-755-1=0+0+0+1 or 'Hz8lCbzi'='
ubaTaeCJ
-1' OR 3*2<(0+5+755-755) or 'Hz8lCbzi'='
ubaTaeCJ
-1' OR 3*2>(0+5+755-755) or 'Hz8lCbzi'='
ubaTaeCJ
-1" OR 2+602-602-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3+602-602-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3*2<(0+5+602-602) --
ubaTaeCJ
-1" OR 3*2>(0+5+602-602) --
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
zTBqCQNN'; waitfor delay '0:0:15' --
ubaTaeCJ
-5 OR 634=(SELECT 634 FROM PG_SLEEP(15))--
ubaTaeCJ
-5) OR 168=(SELECT 168 FROM PG_SLEEP(15))--
ubaTaeCJ
-1)) OR 451=(SELECT 451 FROM PG_SLEEP(15))--
ubaTaeCJ
WQMTg3IZ' OR 110=(SELECT 110 FROM PG_SLEEP(15))--
ubaTaeCJ
zbpn7PzI') OR 296=(SELECT 296 FROM PG_SLEEP(15))--
ubaTaeCJ
rpcuuQJP')) OR 491=(SELECT 491 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
@@smjob