Welcome to Westonci.ca, where curiosity meets expertise. Ask any question and receive fast, accurate answers from our knowledgeable community. Connect with professionals ready to provide precise answers to your questions on our comprehensive Q&A platform. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

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