Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-4602 authored May 14, 2024
1 parent 78cea23 commit ccaa8ad
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
from akinator_python import Akinator

akinator=Akinator(lang="en")
print(akinator.start_game())
akinator.start_game()
while True:
ans=input("answer:")
if ans=="b":
print(akinator.go_back()['question'])
else:
response=akinator.post_answer(ans)
if "id_proposition" in response:
print(f"{response['name_proposition']} / {response['description_proposition']}")
ans=input("is it correct?:")
if ans=="n":
print(akinator.exclude()['question'])
elif ans=="y":
break
try:
print(akinator.question)
ans=input("answer:")
if ans=="b":
akinator.go_back()
else:
print(response['question'])
akinator.post_answer(ans)
if akinator.answer_id:
print(f"{akinator.name} / {akinator.description}")
ans=input("is it correct?:")
if ans=="n":
akinator.exclude()
elif ans=="y":
break
else:
break
except Exception as e:
print(e)
continue

0 comments on commit ccaa8ad

Please sign in to comment.