Ich habe vorher falsche Fehler Meldung kopiert:
Traceback (most recent call last):
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test.py", line 17, in <module>
main()
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test.py", line 14, in main
print(path_length(trail))
File "C:\Users\bbavi ...
Die Suche ergab 8 Treffer
- Freitag 18. November 2022, 10:57
- Forum: Allgemeine Fragen
- Thema: Trail length
- Antworten: 9
- Zugriffe: 701
- Freitag 18. November 2022, 10:52
- Forum: Allgemeine Fragen
- Thema: Trail length
- Antworten: 9
- Zugriffe: 701
Re: Trail length
Das sind die Fehler meldung:
Traceback (most recent call last):
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test1.py", line 17, in <module>
main()
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test1.py", line 14, in main
print(path_length(trail))
File "C:\Users\bbavi\Desktop\Informatik_1 ...
Traceback (most recent call last):
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test1.py", line 17, in <module>
main()
File "C:\Users\bbavi\Desktop\Informatik_1\P05_1\Test1.py", line 14, in main
print(path_length(trail))
File "C:\Users\bbavi\Desktop\Informatik_1 ...
- Freitag 18. November 2022, 10:00
- Forum: Allgemeine Fragen
- Thema: Trail length
- Antworten: 9
- Zugriffe: 701
Re: Trail length
from math import sqrt
def path_length(trail):
for i in range(len(trail) - 1):
for j in range(i + 1, len(trail)):
x = trail [0]
y = trail [1]
lv = sqrt((x[j]-x[j-1])**2 + (y[j]-y[j-1])**2)
L = sum(lv)
return L
def main():
trail = [ (142.492, 208.536), (142.658, 207.060), (143.522, 205.978 ...
def path_length(trail):
for i in range(len(trail) - 1):
for j in range(i + 1, len(trail)):
x = trail [0]
y = trail [1]
lv = sqrt((x[j]-x[j-1])**2 + (y[j]-y[j-1])**2)
L = sum(lv)
return L
def main():
trail = [ (142.492, 208.536), (142.658, 207.060), (143.522, 205.978 ...
- Freitag 18. November 2022, 09:41
- Forum: Allgemeine Fragen
- Thema: Trail length
- Antworten: 9
- Zugriffe: 701
Trail length
Ich will den for i in range() aus den Eckigeklammer nehmen und einmal benutzen, irgendwie klappt es nicht.
from math import sqrt
def path_length(trail):
n = len(trail)
x = [trail [0] for i in range(n)]
y = [trail [1] for i in range(n)]
lv = [sqrt((x -x[i-1])**2 + (y -y[i-1])**2) for i in range ...
from math import sqrt
def path_length(trail):
n = len(trail)
x = [trail [0] for i in range(n)]
y = [trail [1] for i in range(n)]
lv = [sqrt((x -x[i-1])**2 + (y -y[i-1])**2) for i in range ...
- Freitag 11. November 2022, 21:13
- Forum: Allgemeine Fragen
- Thema: Geschlecht Erkennung von Text mit Python programmieren
- Antworten: 7
- Zugriffe: 741
Re: Geschlecht Erkennung von Text mit Python programmieren
Kann mir da jemand helfen beim Programmieren. Ich bin ein Anfänger.
- Freitag 11. November 2022, 21:09
- Forum: Allgemeine Fragen
- Thema: Geschlecht Erkennung von Text mit Python programmieren
- Antworten: 7
- Zugriffe: 741
Re: Geschlecht Erkennung von Text mit Python programmieren
Ich verstehe es nicht, wie man das unterscheiden von Man zu Frau programmiert. Ich bin kein Programmierer habe in der Schule ein neben Fach.
- Freitag 11. November 2022, 19:49
- Forum: Allgemeine Fragen
- Thema: Geschlecht Erkennung von Text mit Python programmieren
- Antworten: 7
- Zugriffe: 741
Re: Geschlecht Erkennung von Text mit Python programmieren
2.2 Gender Detection in Text
Write functions to automatically detect certain features of a text document (such as the gender of the author). For all functions, assume a text document as input in form of a single string, and create meaningful function- and parameter-names.
Background: The average ...
Write functions to automatically detect certain features of a text document (such as the gender of the author). For all functions, assume a text document as input in form of a single string, and create meaningful function- and parameter-names.
Background: The average ...
- Freitag 11. November 2022, 19:18
- Forum: Allgemeine Fragen
- Thema: Geschlecht Erkennung von Text mit Python programmieren
- Antworten: 7
- Zugriffe: 741
Geschlecht Erkennung von Text mit Python programmieren
Ich muss ein Programm schreiben, dass ein Geschlecht erkennt durch ein Text.
Aufgabestellung:
Use the developed functions to write a program which does very basic gender detection.
E.g., you could implement a rule of thumb that decides "male" if less than x words are given in response to a prompt ...
Aufgabestellung:
Use the developed functions to write a program which does very basic gender detection.
E.g., you could implement a rule of thumb that decides "male" if less than x words are given in response to a prompt ...
