+ 1

In Python hen i run my programme it get an extra empty line, how to avoid this ?

13th May 2022, 5:39 AM
Abdelwahab Ghassan Sabbagh
Abdelwahab Ghassan Sabbagh - avatar
7 Answers
0
Maybe you have to put "i = input()" instead of "i = 'python is great, its awesome!'"
13th May 2022, 6:19 AM
OrHy3
OrHy3 - avatar
+ 2
Do print(end=''). By default print() has end='\n', printing newline after every new printed output
13th May 2022, 5:48 AM
OrHy3
OrHy3 - avatar
0
I tried it but didn't worked, kindly write what should i write exactly With gratitude.
13th May 2022, 5:55 AM
Abdelwahab Ghassan Sabbagh
Abdelwahab Ghassan Sabbagh - avatar
0
You do print('CONTENT') every time, right? Only the LAST time do print('CONTENT', end='') instead
13th May 2022, 6:05 AM
OrHy3
OrHy3 - avatar
0
Thanks a million my friend, it worked.
13th May 2022, 6:09 AM
Abdelwahab Ghassan Sabbagh
Abdelwahab Ghassan Sabbagh - avatar
0
If i may ask you one more question please. #my code goes here i="python is great, its awesome!" count=0 for w in i: if w =="a" or w=="e" or w=="i" or w=="u" or w=="o": count+=1 print(count,end="") Now the output is currect but still not giving me any mark, why do you think what is wrong.
13th May 2022, 6:15 AM
Abdelwahab Ghassan Sabbagh
Abdelwahab Ghassan Sabbagh - avatar
0
Your 100% right, i tried it and it worked Many thanks for your help
13th May 2022, 6:22 AM
Abdelwahab Ghassan Sabbagh
Abdelwahab Ghassan Sabbagh - avatar