Python Forum

Full Version: [Newbie] Multiple Array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, im just new in this python language,
Im seeking some advice or help on return value
My situation / scenario is like this :
im currently working with communication port and the device sending 2 value at a time in 2 line
so how can i manipulate the output ( result ) to be as 1 line , as example :
- current value :
XA123
XB124

to be XA123,XB124 like this..

thanks in advance..
Assuming a string object:

string = 'XA123\nXB124'

print(string)
print(string.replace('\n', ','))
Output:
XA123 XB124 XA123,XB124
Thank you @rob101
Hi @Iusyanse , feel free to sent me pm