jeudi 16 mai 2019

how to check if two variable are same or not by using if or statement

in the below code , am trying to check if posted content have any keyword as "whatis" or "what" , everything works , but when I put if statement it show syntax error

def addsearch(request):
    addsearch = request.POST.get('searchcontent')
    wordlist = re.sub("[^\w]", " ", addsearch).split()


    s = ''.join(wordlist)
    question = re.findall('whatis', s)[0]

    q = ''.join(wordlist)
    question1 = re.findall('what', q)[0]

    q1 = "what" , q2 ="whatis"
    if question == q2 or question1 == q1
        abc = "this is a question"

    return render(request, 'searchme.html', {"addsearch": addsearch, "splitcontent":wordlist,"question":question,"abc":abc})

Aucun commentaire:

Enregistrer un commentaire