ОК, так что я не уверен, что им делать неправильно здесь, но мой код автоматически выбирая первый в «если» заявление для exmaple еслиМой «если» заявления Арент работает
if 1 == 2
print("Works")
elif 1 == 1
print("There we go")
это автоматически выберет первый вариант, даже если введено неправильное значение. См. мой код ниже:
def troubleshoot():
print("Now we will try and help you with your iPhone.")
print("")
time.sleep(1)
hardsoft = input(str("Is the issue a problem with hardware of software? Write n if you are not sure: ")) #ISSUE WITH IT SELECTING THE FIRST ONE NO MATER WHAT#
if hardsoft == "Software" or "software" or "S" or "s" or "soft" or "Soft":
software()
elif hardsoft == "Hardware" or "hardware" or "Hard" or "hard" or "h" or "H":
hardware()
elif hardsoft == "Not sure" or "not" or "Not" or "NOT" or "not sure" or "n" or "N":
notsure()
else:
print("Sorry, that command was not recognised")
print("Please try again")
troubleshoot()
В вашем первом блоке кода отсутствуют двоеточия и отступы. Это пропущенная копия-вставка или ваш код выглядит именно так? – Celeo
'if hardsoft == 'Software' или hardsoft == 'software' или hardsoft == 'S' ....' Или 'if 'S' == hardsoft [: 1] .upper():' –