repl.it
@CBingman/

CSSSeperator

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
num_of_lines = int(input());
list_of_values = [];
isBracket = False;

for i in range(num_of_lines):
  isHashesFound = False;
  current_line = input();
  split_current_line = list(current_line);
  if(current_line.find('{') >= 0):
    isBracket = True;
    continue;
    if(current_line.find('#') >= 0):
      continue;
  if(isBracket == True and current_line.find('}') >= 0):
    isBracket = False;
  
  
  if(current_line.find('#') >= 0 and isBracket == True):
    while(isHashesFound == False):
      location_of_hash = current_line.find('#');
      if(split_current_line[location_of_hash + 4].isalpha() or split_current_line[location_of_hash + 4].isalnum()):
        list_of_values.append(''.join(split_current_line[location_of_hash] + split_current_line[location_of_hash + 1] + split_current_line[location_of_hash + 2] + split_current_line[location_of_hash + 3] + split_current_line[location_of_hash + 4] + split_current_line[location_of_hash + 5]+ split_current_line[location_of_hash + 6]));
        split_current_line[location_of_hash] = 'X';
        current_line = ''.join(split_current_line);
      else:
        list_of_values.append(''.join(split_current_line[location_of_hash] + split_current_line[location_of_hash + 1] + split_current_line[location_of_hash + 2] + split_current_line[location_of_hash + 3]));
        split_current_line[location_of_hash] = 'X';
        current_line = ''.join(split_current_line);
      if(current_line.find('#') >= 0):
        isHashesFound = False;
      else:
        isHashesFound = True;
    

for i in range(len(list_of_values)):
  if(list_of_values[i].find('G') >= 0 or list_of_values[i].find('H') >= 0 or list_of_values[i].find('I') >= 0 or list_of_values[i].find('J') >= 0 or list_of_values[i].find('K') >= 0 or list_of_values[i].find('L') >= 0 or list_of_values[i].find('M') >= 0 or list_of_values[i].find('N') >= 0 or list_of_values[i].find('O') >= 0 or list_of_values[i].find('P') >= 0 or list_of_values[i].find('Q') >= 0 or list_of_values[i].find('R') >= 0 or list_of_values[i].find('S') >= 0 or list_of_values[i].find('T') >= 0 or list_of_values[i].find('U') >= 0 or list_of_values[i].find('V') >= 0 or list_of_values[i].find('W') >= 0 or list_of_values[i].find('X') >= 0 or list_of_values[i].find('Y') >= 0 or list_of_values[i].find('Z') >= 0):
      list_of_values.remove(list_of_values[i])


for i in range(len(list_of_values)):
  print(list_of_values[i]);
Fetching token
?