• Register
100 points
4

Overview

Today we are going to Discuss python list of characters to string in kodlogs

List of characters to string

Although Python approves you to get admission to character characters of a string the use of index operator [] and also lets in you to without difficulty iterate over a string, however relying upon your use case you would possibly favor to create a listing from characters of a string. This can be executed both the usage of the listing constructor or the listing comprehension. How to get entry to and extract parts of strings, and additionally be acquainted with the strategies that are on hand to manipulate and adjust string data.

Integer & Float lists

Integers and floats are records kinds that deal with numbers. To convert the integer to float, use the float() feature in Python If you choose to convert flow to integer variable kind in Python. You have to use the int () feature of Python. Pass the go with the flow variable as the argument of the int () feature in Python. 

>>>a=['w','x','y','z']
O/P
'wxyz'
>>>a=['L','M','N','O']
>>>' '.join(a)
O/P
'LMNO'

Next Example 

>>>Input:['K','o','d','l','o','g','s','T','a','n','i','a']
>>>Print(convert (s))
OUTPUT 
KodlogsTania


>>>input:['P','y','t','h','o','n,'k','o','d','l','o','g','s','R','u','b','y']
>>>Print(string(s))
OUTPUT 
PythonkodlogsRuby

Int & float

a=[6,7,2.6,8,9,6.5]
Print ("_".join(list(map(str,a))))
OUTPUT 
6-7-2.6-8-9-6.5

 

100 points
4