Skip to content

Commit ba62b59

Browse files
committed
second update
1 parent 804fa89 commit ba62b59

2 files changed

Lines changed: 16 additions & 36 deletions

File tree

001_Introduction/example002.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# End of lines are automatically included in the string, but it’s possible to prevent this by adding a \ at the end of the line.
33

44
print("""
5-
Usage: thingy [OPTIONS]
6-
-h Display this usage message
7-
-H hostname Hostname to connect to
5+
Welcome to Exenario:
6+
Benefits: Learn Explore Share Connect
7+
- Java Display this usage message
8+
- Python Hostname to connect to
89
9-
Welcome to Exenario
10+
Stay Tune, Stay Connected!!
1011
""")

test.py

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
1-
import string
2-
import random
3-
from base64 import b64encode, b64decode
1+
# Definition of radius
2+
r = 2
43

5-
FLAG = 'flag{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}'
4+
# Import the math package
5+
import math
66

7-
enc_ciphers = ['rot13', 'b64e', 'caesar']
8-
# dec_ciphers = ['rot13', 'b64d', 'caesard']
7+
# Calculate C
8+
C = 2*math.pi*r
99

10-
def rot13(s):
11-
_rot13 = string.maketrans(
12-
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
13-
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
14-
return string.translate(s, _rot13)
10+
# Calculate A
11+
A = math.pi*(r**2)
1512

16-
def b64e(s):
17-
return b64encode(s)
18-
19-
def caesar(plaintext, shift=3):
20-
alphabet = string.ascii_lowercase
21-
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
22-
table = string.maketrans(alphabet, shifted_alphabet)
23-
return plaintext.translate(table)
24-
25-
def encode(pt, cnt=50):
26-
tmp = '2{}'.format(b64encode(pt))
27-
for cnt in xrange(cnt):
28-
c = random.choice(enc_ciphers)
29-
i = enc_ciphers.index(c) + 1
30-
_tmp = globals()[c](tmp)
31-
tmp = '{}{}'.format(i, _tmp)
32-
33-
return tmp
34-
35-
if __name__ == '__main__':
36-
print (encode(FLAG, cnt=?))
13+
# Build printout
14+
print("Circumference: " + str(C))
15+
print("Area: " + str(A))

0 commit comments

Comments
 (0)