File tree 1 file changed +35
-24
lines changed
1 file changed +35
-24
lines changed Original file line number Diff line number Diff line change 2
2
3
3
4
4
def main ():
5
- this_this = first_step ()
6
5
hint = "va gur snpr bs jung?"
7
- second_step (hint , this_this )
8
-
9
-
10
- def first_step ():
11
- return this .s
12
-
13
-
14
- def second_step (hint , this_this ):
15
- hint_ary = hint .split (" " )
16
- len_hint_ary = []
17
- for element in hint_ary :
18
- len_hint_ary .append (len (element ))
19
- print (len_hint_ary )
20
-
21
- lines_of_this = str (this_this ).split ("\n " )
22
- print (lines_of_this )
23
- len_str_in_line = []
24
- for line in lines_of_this :
25
- str_in_line = line .split (" " )
26
- for str_ele in str_in_line :
27
- len_str_in_line .append (len (str_ele ))
28
- print (len_str_in_line )
29
- len_str_in_line = []
6
+ first_step (hint )
7
+ hint2 = "in the face of what?"
8
+ second_step ("va gur snpr bs" )
9
+
10
+
11
+ def first_step (hint ):
12
+ rot13 (hint )
13
+
14
+
15
+ def rot13 (s ):
16
+ result = ""
17
+ for c in s :
18
+ if c .isalpha ():
19
+ ord_c = ord (c )
20
+ ord_c_plus_13 = ord (c ) + 13
21
+ if ord_c >= ord ("a" ) and ord_c <= ord ("z" ):
22
+ if ord_c_plus_13 > ord ("z" ):
23
+ c = chr (ord_c_plus_13 - 26 )
24
+ else :
25
+ c = chr (ord_c_plus_13 )
26
+ elif ord_c >= ord ("A" ) and ord_c <= ord ("Z" ):
27
+ if ord_c_plus_13 > ord ("Z" ):
28
+ c = chr (ord_c_plus_13 - 26 )
29
+ else :
30
+ c = chr (ord_c_plus_13 )
31
+ result += c
32
+ return result
33
+
34
+
35
+ def second_step (hint2 ):
36
+ this_content = this .s
37
+ lines = this_content .split ("\n " )
38
+ for line in lines :
39
+ if hint2 in line .lower ():
40
+ print (rot13 (line ))
30
41
31
42
32
43
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments