Solution: Write a Character Introduction
In this example, we’re creating a character profile using multiple variables to store different pieces of information about the character.
Each line before
print()stores information in a variable:name,species,home_planet, andspecial_abilityare strings (text values inside quotes).ageis a number (integer).
The
print()statements display a short description using these variables.The
+sign is used here to join text parts together (for example, adding"."or"!"at the end of a sentence).Commas in
print()separate words and variables, and Python automatically adds spaces between them.
Solution: Write a Character Introduction
In this example, we’re creating a character profile using multiple variables to store different pieces of information about the character.
Each line before
print()stores information in a variable:name,species,home_planet, andspecial_abilityare strings (text values inside quotes).ageis a number (integer).
The
print()statements display a short description using these variables.The
+sign is used here to join text parts together (for example, adding"."or"!"at the end of a sentence).Commas in
print()separate words and variables, and Python automatically adds spaces between them.