0

i want to to print "fruits" in one line but its not working.can anyone help me using for loop in python

https://code.sololearn.com/cdvr5TwfMKUY/?ref=app

4th Apr 2020, 2:46 PM
HAMZA
3 Answers
+ 1
In python the print goes to next line by default. You can give the end parameter. Try the below code print (x, end="")
4th Apr 2020, 2:49 PM
Abirame Dhevendran
Abirame Dhevendran - avatar
+ 1
Here's one: for x in "fruits": print(x,end="") #(end) means that the printed character will have end data as a string instead of(\n) #therefore output will be(fruits)
4th Apr 2020, 3:16 PM
Tricker
0
can you give example plz
4th Apr 2020, 2:57 PM
HAMZA