I think you’ve already gotten some good answers here regarding the function itself:
It sits and waits for the user to input something and hit Enter, and returns the value the user entered, which is then assigned to your nam variable. (See the documentation for the function.
I might also offer the advice of confirming your understanding of the flow of a program. That is, understand that, in the general sense, the computer must resolve the right-hand side of the equals sign to a value before it can assign it to the left.
For example, if the right-hand side is a literal value, it’s already resolved. For example, a line like name = “Joe” is easy—assign the string literal “Joe” to the variable name, when the line is run.
If the right hand side is a mathematical equation, it must be resolved to a value when the line is run. For example, for a line like value = 2+2, the 2+2 must be resolved to 4 before it can be assigned to the variable.
Then, for something like name = input(“Who are you?”), in order to resolve the right-hand side, the computer must first run the function before it can assign a value to the variable name.
It can, of course, get more complicated, where you can call multiple functions on a line, and the results of one feed into the next, and so on. But, that can be an exercise for the near future.
In a former wallpaper factory in Chiswick, west London, a start-up firm has been developing a long-term storage system that uses lasers to burn tiny holograms into a light-sensitive polymer....
Substitute “walking down a road” with: “having dinner at a conference”, “chatting over lattes at the local coffee shop”, or “at a neighborhood cookout” as makes sense.
Derisking a project 1 year out ( i.imgflip.com )
Anakin Padme meme:...
Could someone help me understand the input() function?
I'm currently learning Python and am learning about very basic functions such as int(), float(), and input()....
Why data is being stored in glass and holograms ( www.bbc.com )
In a former wallpaper factory in Chiswick, west London, a start-up firm has been developing a long-term storage system that uses lasers to burn tiny holograms into a light-sensitive polymer....
Nikki Haley writes ‘finish them’ on IDF artillery shells during Israel visit ( www.theguardian.com )
Any Volunteers ( programming.dev )