Die Suche ergab 3 Treffer
- Freitag 15. Dezember 2023, 13:17
- Forum: Codesnippets
- Thema: Ziegenproblem
- Antworten: 9
- Zugriffe: 6339
Re: Ziegenproblem
if tuer_mit_Auto==1 and 2 and 3: Das pässt .
- Donnerstag 14. Dezember 2023, 14:13
- Forum: Codesnippets
- Thema: Ziegenproblem
- Antworten: 9
- Zugriffe: 6339
Re: Ziegenproblem
from random import randint, seed seed() anzahlspiele=int(input("bitte zähle an das spielen:" )) zaehlerspiele=0 zaehlerAuto=0 while zaehlerspiele < anzahlspiele: tuer_mit_Auto=randint(1,3) tuer_mit_kandidat=randint(1,3) if tuer_mit_Auto==tuer_mit_kandidat: print("du hast en Auto gewon...
- Mittwoch 13. Dezember 2023, 11:21
- Forum: Codesnippets
- Thema: Ziegenproblem
- Antworten: 9
- Zugriffe: 6339
Re: Ziegenproblem
from random import randint, seed seed() #schritt 1 : auto wird versteckt tuerAuto= randint(1,3) # schritt 2: kandidat waehlt eine Tuer aus tuerKandidat= int(input("waehle eine Tuer(1,2,3): ")) # schritt 3: moderator oeffnet eine Tuer if tuerAuto==1: if tuerKandidat==1: muenze=randint(0,1) ...