Skip to content
← Back to Community
I do not know how to write this in python, please help....
Profile icon
NyasiaWarren

The fraction 22/7 is sometimes used as a rough approximation for Pi (3.14159...). Write a Python expression that divides 22 by 7 and assigns the result to a variable named piApproximate.

Answered by DEMONul1234 [earned 5 cycles]
View Answer
Voters
Profile icon
NyasiaWarren
Comments
hotnewtop
Profile icon
DEMONul1234

result = float(22 / 7)
piApproximate = [result]

print(piApproximate)

Profile icon
DEMONul1234

@DEMONul1234 it returns: 3.14 etc.

Profile icon
NyasiaWarren

Thank you so much @DEMONul1234

Question: what does "float means"

Profile icon
SixBeeps

@NyasiaWarren float is a fancy word for decimal

Profile icon
DEMONul1234

@NyasiaWarren Oh, It just helps with odd numbers ^^ like 3.98 etc. Could you kindly mark my answer so your question is answered, it'd give me 5 cycles if you can

Profile icon
NyasiaWarren

@DEMONul1234 I did it, do you mid helping me with another question I was stuck on?

Profile icon
DEMONul1234

@NyasiaWarren Sure, what is it?

Profile icon
NyasiaWarren

@DEMONul1234

Okay here's the question:

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.

Profile icon
NyasiaWarren

ive been reading " how to think like a computer scientist but its not really showing me how to do a question like this, im so [email protected]

Profile icon
DEMONul1234

@NyasiaWarren Replied on your question in ask section

Profile icon
teaganturner

our task assist with the absolute best nature of administration. we offer different kinds of scholastic administrations like exposition writing, propositions, tasks, project the executives papers and so on. The significant undertaking for an essay author writingblade is to pick a dependable and reasonable wellspring of online essay writing help. There are numerous internet based destinations that proposition such assistance, and pursuing informed choice on the most ideal choice might rely upon some guidance. Here are a few overall rules to observe while utilizing a web-based essay writing administration on the web: