Il nostro insegnante di geometria ci ha dato un incarico chiedendoci di creare un esempio di quando il giocattolo usa la geometria nella vita reale, quindi ho pensato che sarebbe stato bello creare un programma che calcoli quanti galloni d'acqua saranno necessari per riempire una piscina di una certa forma e con determinate dimensioni.Non è possibile concatenare oggetti 'str' e 'float'?
Ecco il programma finora:
import easygui
easygui.msgbox("This program will help determine how many gallons will be needed to fill up a pool based off of the dimensions given.")
pool=easygui.buttonbox("What is the shape of the pool?",
choices=['square/rectangle','circle'])
if pool=='circle':
height=easygui.enterbox("How deep is the pool?")
radius=easygui.enterbox("What is the distance between the edge of the pool and the center of the pool (radius)?")
easygui.msgbox=("You need "+(3.14*(float(radius)**2) * float(height)) + "gallons of water to fill this pool.")
io continuo a ricevere questo errore se: easygui.msgbox = ("devi" + (3.14 * (float (raggio) ** 2) * galleggiante (altezza)) + "litri d'acqua per riempire questa piscina.") TypeError: impossibile concatenare gli oggetti 'str' e 'float'
cosa devo fare?