0
place holder ?!!!!
i wanted to ask what is a place holder when should i start to use i have used c++ for many projects and recently started python but i have only read the don't know when i should use that thing so according to google: In computer programming, a placeholder is a character, word, or string of characters that may be used to take up space until such a time that the space is needed but when i define a variable isn't it initialized and has its unique address and location and i have no problem calling it with the name i gave this place so why do people use this thing i called place holder
3 odpowiedzi
+ 1
place holders are mostly used in examples in Python to declare variables. They fill up the memory address and define the datatype since in Python you can't just declare a variable without initializing it because variables take their datatype from the assignment. Doing so would produce an error since the compiler won't understand what you mean. In C++ when you declare a variable, you don't have to initialize it -- you can just say int var; . But in Python, writing var only without an assignment like var = 'meow' won't be interpreted as a variable. Yes variables are unique. A variable is a name of a location in memory, therefore every variable is an address.
0
but why does a place holder have to static in every programming languages for example the place holders are "spam" and "eggs" but in other languages like c++ it is "foo"
0
Those are just jokes used to demonstrate methodologies. Spam and eggs are from the comedy series Monty Python and foo is part of foobar.