word=input('Enter a word');Enter a word:cheese;print(word+'shop') why space comes in between cheese nd shop
Space doesnt come in b/w cheese and shop unless you enter 'cheese ' as the input.
If you want to make sure that there is no white space before or after the word that is entered you can use the str.strip() method. print(word.strip() + 'shop') You could also use it chained to the input function, since it returns a string. word=input('Enter a word').strip() There is also a left strip which only removes white space on the left of the string, and right strip which removes white space on the right of the string. lstrip() rstrip()
Ans cheee shop
I got struggled in that too. It has nothing to do with input, they made a trick. It was written print(word + ' shop'), if you look carefully, you will notice the space BEFORE shop
What is indentations... ?
What is the best coding language
YouTube Link Finder