Umfang und den Flacheninhalt des Kreises bestimmen mit dem Python?

Hallo

, ich brauche Hilfe.

man soll 2 Python Programme mit oben stehende Formeln ( Formeln zur Bestimmung des Radius des Inkreises im Dreieck)

schreiben, die jeweils den Umfang und

den Flacheninhalt des Kreises bestimmen.Erste program soll nur mit a,b und c sein und zweite program mit h(höher), β und γ(gamma) sein, längen sollen in cm und Winkel soll in grad sein.

Ich habe es versucht, aber mein Programm hat nicht funktioniert, ich möchte bitten kann mir jemand zeigen, wie man dafür die richtige Programme schreiben kann?

hier ist mein code.

from math import sqrt

a = float(input('Koeffizient a: '))

b = float(input('Koeffizient b: '))

c = float(input('Koeffizient c: '))

frage = int(input ("ist f bekannt? :")

if frage == "yes":

f = float(input('f eingeben :'))

r = (f+f) / (a + b + c)

p = round(2 * 3.14 * r, 2)

area = round(3.14 * r * r, 2)

print ("p=", p)

print("area =",area)

else:

s = (a+b+c)/2

r1 = sqrt((s-a)(s-b)(s-c)/s)

area1=round((3.14*r1*r1,2))

p1=round(2*3.14*r1,2)

print("area1=",area1)

print("p1=",p1)

hier zum beispiel.f ist A(flächeninhalt von Dreieck) hier. ich möchte ein programm schreiben das fragt wenn A bekannt ist dann berechnet das programm den radius mit 2f/a+b+c fomel wenn nicht dann mit dieser formeln s = (a+b+c)/2 ,r1 = sqrt((s-a)(s-b)(s-c)/s). Ich benant radius hier r1. aber ich weiß nicht, wie ich mein Programm dazu bringen soll, diese Frage zu stellen, es funktioniert nicht, nachdem es gefragt habe, ob f bekannt ist oder nicht.

Grüße

Bild zum Beitrag
Programm, programmieren, Kreis, Informatik, Python
Python tkinter bg wird nicht erkannt?

Hallo ich in tkinter ein kleines gui geschrieben, das ein Download anzeigen soll. Das funktioniert auch alles allerdings ist der Hintergrund vom Text nicht genau weis sondern so leicht grau. Deshalb wollte ich den bg von der Schrift umändern, was anscheinend nicht funktioniert D:

Code:

```from tkinter import *
 from tkinter.ttk import *
import time




ws=Tk()
ws.title("Open download-Test")
ws.geometry("600x300")
ws.iconbitmap("F:\Explorer\Bilder\dcqf9q5-dcb565f7-7fc6-4973-a6c1-af6a4e867717.ico")
ws.configure(bg="white")

Progress_Bar=Progressbar(master=ws,orient=HORIZONTAL,length=300)
Progress_Bar.place(x=10, y=150)

Line1 = Label(master=ws, text='You have to wait until the program is fully downloaded:',bg="white", font=('Corbel', 12, 'italic'))
Line1.place(x=10, y=10)

HMH = PhotoImage(file = r"F:\Explorer\Bilder\Screenshot_8.png")
Img1 = Label(ws, image = HMH)
Img1.place(x = 10,y = 40)

Line2 = Label(master=ws, text='download-Test', font=('Corbel', 12,"bold", 'italic'))
Line2.place(x=46, y=43)

Line3 = Label(master=ws, text='which is: Binary File(54 GB) ', font=('Corbel', 12, 'italic'))
Line3.place(x=46, y=68)

Line3 = Label(master=ws, text='from://www.Test.com ', font=('Corbel', 12, 'italic'))
Line3.place(x=46, y=88)

Line3 = Label(master=ws, text='Remaining download time:', font=('Corbel', 12))
Line3.place(x=10, y=118)

cmd1 = Label(master=ws, text='0%', font=('Corbel', 12, 'italic'))
cmd1.place(x=320, y=150)



i = 0
def Slide():
    global i
    while(i<100):
        i = i +1
        Progress_Bar['value'] = i
        ws.update_idletasks()
        time.sleep(1)
        conect = str(i) + "%"
        cmd1.config(text=conect)
    if i == 100:
        print("Finish")

Slide()

mainloop()

Und das ist die fehlermeldung:

Wenn jemand die Antwort weis würde ich mich sehr über eine Antwort freuen.

MFG. Theo

Bild zum Beitrag
programmieren, Python, Tkinter

Meistgelesene Beiträge zum Thema Python