2+2==4
True
2+2==3+1
True
2+2==2+1
False
'hello'=='hello'
True
greeting='hello'
greeting=='hello'
True
greeting=='hi'
False
greeting='hello','hi','bonjour','wassup'
greeting=='bonjour'
False
greeting=='hi'
False
greeting=['hello','hi']
greeting=='hi'
False
greeting=['hello'],['hi']
greeting=='hi'
False
women='men'
women=='men'
True
greeting='hi'
greeting='hello'
greeting=='hi'
False
bonjour='hello'
greeting=='hello'
True
bonjour=='hello'
True
'hello'=='hello'
True
def secret(word):
if word=='please':
return 'yes!'
secret('hello')
secret('please')
'yes!'
def yesno(word):
if word=='yes':
return True
if word=='no':
return False
yesno('haha')
yesno('yes')
True
if word=='please':
return'yes'
else:
return'no'
File "/tmp/ipykernel_6881/3563047155.py", line 2 return'yes' ^ SyntaxError: 'return' outside function
if word=='please':
return True
else:
return False
File "/tmp/ipykernel_6881/2486058534.py", line 2 return True ^ SyntaxError: 'return' outside function