Skip to content
Advertisement

How do i remove special characters in output print (brackets, the (‘) and the comma)

My code :

a='hello'
b= 10
c=a, b
print (c)

The output :

('hello', 10)

the output i want :

hello 10

basically i want to remove the ‘ , () thanks in advance

Advertisement

Answer

Here is a list of all the ways:

#Using f-strings
print(f"{a} {b}")

#List Method
print(*c)

#For Loops
for i in c:
   print(i,end=" ") #MAKES NO SENSE AT ALL. But is a method.

#String Concatenation
print(a+b)

#Print Normally
print(a, b)
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement