Get the answers you need at Westonci.ca, where our expert community is always ready to help with accurate information. Discover a wealth of knowledge from professionals across various disciplines on our user-friendly Q&A platform. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

Assume that you have 22 slices of pizza and 7 friends that are going to share it (you've already eaten). There's been some arguments among your friends, so you've decided to only give people whole slices. Write a Python expression with the values 22 and 7 that calculates the number of whole slices each person would receive and assigns the result to numberOfWholeSlices.

Sagot :

Answer:

In Python:

numberOfWholeSlices = int(22/7)

print(numberOfWholeSlices )

Explanation:

For each friend to get a whole number of slices, we need to make use of the int function to get the integer result when the number of slices is divided by the number of people.

So, the number of slice is: 22/7

In python, the expression when assigned to numberOfWholeSlices  is:

numberOfWholeSlices = int(22/7)

Next, is to print the calculated number of slices

print(numberOfWholeSlices )

Following are the python program to the given question:

Program Explanation:

  • Defining a variable "numberOfWholeSlices".
  • Inside this variable, it divides the integer value and holds the quotient part, and holds only the integer part by using the int method.
  • In the next step, it uses the print method that prints the quotient value holding variable.

Program:

numberOfWholeSlices = int(22/7)#defining a variable "numberOfWholeSlices"

#dividing the integer value and holds the quotient value part and convert the value into integer

print(numberOfWholeSlices )#print the quotient value

'''OR'''

numberOfWholeSlices = 22//7#defining a variable "numberOfWholeSlices" that claculates and hold the quotient value integer part

print(numberOfWholeSlices )#print the quotient value

Output:

Please find the attached file.

Learn more:

brainly.com/question/712334

View image codiepienagoya