Why not just put my name in the string?

Couldn’t we just put our name within the print program as opposed to a different line?

7 Likes

Well, that would not be following the instructions to the letter, which you might find around here goes a long way to a good learning experience.

The lesson shows us how a variable can be assigned with a value, then interpolated into a string and outputed to the console.

There are a number of concepts demonstrated…

  1. strings
  2. variables
  3. assignment
  4. concatenation
  5. printing
18 Likes

Thanks Roy! I’m a beginner and just wanted to be the guy to ask questions about everything for better understanding. Kind of self-teaching/ learning this stuff, not the easiest task.

21 Likes

With more experience the usefulness of this will become understood. It’s a small part of a bigger picture.

4 Likes

Is it necessary to write a variable as my_name, can’t we write like my name?

@giga0346789029, variable names, among other constraints, must include no spaces.

1 Like

Thanks for help, it means a lot.