Python Forum
What should i do, for this code to work -> description
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What should i do, for this code to work -> description
#2
I am not sure if I understand what you want. But perhaps this helps.
message_N = "GO AGAIN BOYS!!!"
message_E = "Nein"
message_J = "Too bad, lmao"
repeat = True

while repeat:
    repeat = False
    question = input('Wie heißt du?')
    answer = input('Bist du Frau oder Mann?')
    message_f = f"Sehr geehrte Frau {question},\nIch grüße dich!"
    message_m = f"Sehr geehrter Herr {question}, \nIch grüße dich!"
    if question == str():
        print(answer)
    if answer == "Mann":
        print(message_m)
    elif answer == "Frau":
        print(message_f)
    else:
        answer = input('Bist du jemanden anderer?')
        print(answer)
        if answer == "Ja":
            print(message_J)
        elif answer == "Nein":
            print(message_N)
            repeat = True
Reply


Messages In This Thread
RE: What should i do, for this code to work -> description - by ibreeden - Nov-18-2021, 11:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I can't for the life of me get this basic If statement code to work CandleType1a 8 374 May-21-2024, 03:58 PM
Last Post: CandleType1a
  Get file description Raysz 2 614 Nov-25-2023, 03:46 PM
Last Post: Raysz
  hi need help to make this code work correctly atulkul1985 5 928 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  newbie question - can't make code work tronic72 2 780 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Beginner: Code not work when longer list raiviscoding 2 919 May-19-2023, 11:19 AM
Last Post: deanhystad
  Why doesn't this code work? What is wrong with path? Melcu54 7 1,992 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  Code used to work 100%, now sometimes works! muzicman0 5 1,580 Jan-13-2023, 05:09 PM
Last Post: muzicman0
  color code doesn't work harryvl 1 983 Dec-29-2022, 08:59 PM
Last Post: deanhystad
  Something the code dont work AlexPython 13 2,478 Oct-17-2022, 08:34 PM
Last Post: AlexPython
  Why is the 'meta description' html tag not translated? Melcu54 2 1,025 Oct-15-2022, 10:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020