in Education by
I have a list in Python e.g. letters = ["t", "h", "e"] I want to print the array in a single line without the normal " [] names = ["t", "h", "e"] print (letters) Will give the output as; ["t", "h", "e"] That is not the format I want instead I want it to be like this; t, h, e Note: It must be in a single row. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Try the code given below, all the elements will be separated with a comma. name= [“t”,”h”,”e”] Print ( ‘,’ .join(name)) Output:- t,h,e

Related questions

0 votes
    There are many ways to write stderr: # Note: this first one does not work in Python 3 print >> sys.stderr, " ... obvious way to do it. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    >>> a=[1,2,3] >>> a.remove(2) >>> a [1, 3] >>> a=[1,2,3] >>> del a[1] >>> a ... above three methods to remove an element from a list? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to figure out Python lambdas. Is lambda one of those "interesting" language items that in ... maintenance coder nightmare. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm looking through the Apple's Vision API documentation and I see a couple of classes that relate to text ... overview of Vision. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How do I convert a hex string to an int in Python? I may have it as "0xffff" or just "ffff". Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
0 votes
    I have two lists in Python, like these: temp1 = ['One', 'Two', 'Three', 'Four'] temp2 = ['One' ... ways without cycles and checking? Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
+1 vote
    Is it possible to use curly brackets ({}) to enclose a single line code in C program?...
asked Nov 8, 2020 in Technology by JackTerrance
0 votes
    In [60]: print(row.index) Int64Index([15], dtype='int64') I already know that the row number is ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I have the following dataframe using pandas df = pd.DataFrame({'Last_Name': ['Smith', None, 'Brown ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    I have the following dataframe using pandas df = pd.DataFrame({'Last_Name': ['Smith', None, 'Brown ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I have the following dataframe using pandas df = pd.DataFrame({'Last_Name': ['Smith', None, 'Brown ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    I have the following dataframe using pandas df = pd.DataFrame({'Last_Name': ['Smith', None, 'Brown ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 8, 2022 in Education by JackTerrance
0 votes
    I have the pandas data frame with a column designated to town names. After each town name, I am adding a word " ... .csv', index=False) Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I have the pandas data frame with the column designated to town names. After each town name, I am adding a word ... .csv', index=False) Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    To the data frame df: Player Team Points Mean Price Value Gameweek 1 Jim Leeds 4.4 4.40 10.44 0.44 2 Jim ... scalar What am I missing? Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
...