GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 7 von 11 · Text

LAB

David Khieu

LAB

Objectives

  • becoming familiar with the concept of storing and working with different data types in Python
  • experimenting with Python code.

Scenario

Here is a short story:

Once upon a time in Appleland, John had three apples, Mary had five apples, and Adam had six apples. They were all very happy and lived for a long time. End of story.

Your task is to: 

  • create the variables: john, mary, and adam
  • assign values to the variables. The values must be equal to the numbers of fruit possessed by John, Mary, and Adam respectively
  • having stored the numbers in the variables, print the variables on one line, and separate each of them with a comma
  • now create a new variable named total_apples equal to addition of the three former variables
  • print the value stored in total_apples to the console
  • experiment with your code: create new variables, assign different values to them, and perform various arithmetic operations on them (e.g., +, /, // , etc. ). Try to print a string and an integer together on one line, e.g., "Total number of apples:" and total_apples.

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck