repl.it
@peachyog/

Boolean

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
phrase = input()
words = phrase.split(' ')
count = 0
for i in range(len(words)-1):
  if words[i] == "not":
    count +=1
if count%2 == 0:
  print(words[len(words)-1])
elif count%2 == 1 and words[len(words)-1] == "False":
  print("True")
elif count%2 == 1 and words[len(words)-1] == "True":
  print("False")
Fetching token
?