concept string in category raspberry pi

appears as: strings, A string, string, The strings, strings
Hello Raspberry Pi!: Python programming for kids and other beginners

This is an excerpt from Manning's book Hello Raspberry Pi!: Python programming for kids and other beginners.

Storing strings in variables

Life isn’t only about numbers. You may want to create programs that display absurd messages or tell a story on the screen. These messages are a type of data called strings. A string is a group of characters.

  • When a number is placed inside quotation marks, it’s a string.
  • Strings can be short (zero or only a few characters) or many characters long.
  • Strings can even be empty. These are called zero-length strings:
    my_string = ""
  • Figure 2.11. The Python print function can display text on the screen repeatedly if you use it with a string and the multiplication operator (*).