I tried every method I could find online but non of them worked. Can someone help me to turn everything in lista lowercase. I try to find duplicates in it but it doesn’t count a lowercase and an uppercase character as duplicate.
JavaScript
x
33
33
1
from sys import stdin, stdout
2
3
def main():
4
n = int(stdin.readline())
5
iso = 0
6
if n <= 0:
7
print("Nope")
8
else:
9
lista = []
10
m = n
11
while m != 0:
12
lista.append(stdin.readline())
13
m -= 1
14
l = 0
15
16
while l < n:
17
lst = list(lista[l])
18
bol = False
19
if " " in lst:
20
lst.remove(" ")
21
if "n" in lst:
22
lst.remove("n")
23
for i in lst:
24
if lst.count(i) < 3:
25
bol = True
26
if bol == True:
27
iso += 1
28
l += 1
29
30
stdout.write(str(iso))
31
32
main()
33
Advertisement
Answer
While reading in the inputs you can do:
JavaScript
1
5
1
while m != 0:
2
read_in_string = stdin.readline()
3
lista.append(read_in_string.lower())
4
m -= 1
5
To make the things in lista lower case