๐Ÿ
B.TECH I YEAR โ€ข II SEMESTER โ€ข R25

Python Programming - Lab Manual

Python Programming Laboratory โ€ข Program Solution

๐Ÿ“˜ R25 Regulation ๐ŸŽ“ I Year ๐Ÿ“š II Semester ๐Ÿ Python Programming ๐Ÿงช Lab Program
Selected Program

Add a comma between the characters

โ† All Python Programs

Aim:

☛   Add a comma between the characters. If the given word is 'Apple', it should become 'A,p,p,l,e'.

Solution :


PROGRAM: (add_comma.py)

 
def add_comma(x):
	return ','.join(x)

in_str = "Apple"
print(add_comma(in_str))

OUTPUT:

 
 A,p,p,l,e


๐Ÿ’ป Run This Python Program

Add a comma between the characters
The selected Python program is loaded automatically into the editor. Edit the program, provide input if required and click Run.

The compiler is embedded using OneCompiler. Your Python program runs inside the embedded Python environment; Study Glance does not execute Python code directly on your web server.
โ† Back to Python Lab Programs ๐Ÿ“š All Lab Manuals