+ 6
What is end=" " in python?
7 Answers
+ 7
Here,
end = " "
is an expression on python that assigns a value to a variable. Here end is a variable. It can contain any value. We can use this value to our program.
Write the following code to python code playground to understand the expression:
end = "Hello World"
print(end);
+ 3
print('hello')
print('world')
#prints :
#hello
#world
print('hello',end=' ')
print('world')
#prints : hello world
#for more :
#https://www.geeksforgeeks.org/gfact-50-JUMP_LINK__&&__python__&&__JUMP_LINK-end-parameter-in-print/
#https://www.geeksforgeeks.org/python-sep-parameter-print/
+ 1
Adnan Zawad Toky Ohh! Got it! Thanks!
+ 1
'end=" "' is a variable being declared.
It is saying that the variable "end" will have the value " " (a space).
When the variable gets called upon, most likely to be printed, a space will be displayed instead of the word "end".
The syntax for declaring a variable is:
VARIABLE_NAME = VARIABLE_VALUE
Anytime you see something = (one "=") something else, like x = y, you're looking at a variable being created. The word to the left of the "=" is the name of the variable, and everything to the right is its value.
Hope that helps
0
If you're asking for the type of end is a class str
0
Andrés Torres Albuja Daljeet Singh thanks!
0
It asigns end to a space