-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpep8.py
More file actions
69 lines (60 loc) · 1.56 KB
/
pep8.py
File metadata and controls
69 lines (60 loc) · 1.56 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import math
import datetime
from math import sqrt
from os import *
def take_all_list(arg1, arg2, arg3=0, *args, **kwargs):
"""Docstring for take_all_list.
Basically, this is a useless function, but would test how well you know about PEP-8.
"""
list_a = [1, 2, 3, 4, 5]
var_b = list_a[0] * list_a[1] + list_a[2] - (3 + list_a[3])
print(arg1, arg2)
if arg3 != 0:
print(arg3)
if 5 < arg3 < 10:
list_a.append(arg3)
print(f"This is to ensure that our list would be printed ==> {list_a}")
else:
list_a = None
print(var_b)
if list_a is not None:
print("list_a has an entry")
def print_all_number(n):
m = 0
first = n
second = n + 1
third = n + 2
fourth = n + 3
print(first, second, third, fourth)
for n in range(n):
print(n)
m += n
print(m)
checker = m > sum(range(n))
if checker:
print("TAMA!")
else:
print("MALI!")
class ThisIsStudentClass:
FIRSTNAME = 'A'
LASTNAME = 'A'
def __init__(self, age, address):
self.AGE = age
self.ADDRESS = address
def get_name(self):
return f"{self.LASTNAME}, {self.FIRSTNAME}"
def another_function():
print(math.pi)
sqrt_of_pi = sqrt(math.pi)
print("It's the square root of pi", sqrt_of_pi)
string_sample = "Why, hello there!"
print(string_sample[1::2])
take_all_list(1, 2, 3)
try:
l = 2
m = 3
n = l + m
except Exception:
print("ERROR!")
return math.pi
take_all_list(l, m, n)