Skip to content

Commit d4fb375

Browse files
author
Vimal A R
committed
* Code format cleanup with Black.
1 parent 013991f commit d4fb375

File tree

171 files changed

+730
-579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+730
-579
lines changed

Day-001/01-strings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
# Quotes can be either single, double, or triple.
66
string_1 = "Day 1 of #100DaysofCode!"
7-
string_2 = 'Day 1 of #100DaysofCode!'
7+
string_2 = "Day 1 of #100DaysofCode!"
88
string_3 = """Day 1 of #100DaysofCode!"""
9-
string_4 = '''Day 1 of #100DaysofCode!'''
9+
string_4 = """Day 1 of #100DaysofCode!"""
1010

1111
# If the line contains a single quote,
1212
# escape it with double quotes
@@ -36,4 +36,4 @@
3636
# String concatenation
3737
# Strings can be concatenated
3838
string_11 = string_10 + string_9
39-
print(string_11)
39+
print(string_11)

Day-002/02-string-slicing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
print(string_1[0:])
99
print(string_1[1:])
1010
print(string_1[:-1])
11-
print(string_1[0:-5])
11+
print(string_1[0:-5])

Day-003/01-string-formatting.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,24 @@
3535
print("%(value)s, %(value)s, %(value)s" % {"value": "SPAM"})
3636

3737
# Integers
38-
print("%(a)i + %(b)i + %(c)i = %(d)i" %
39-
{"a": 1, "b": 2, "c": 3, "d": 7})
38+
print("%(a)i + %(b)i + %(c)i = %(d)i" % {"a": 1, "b": 2, "c": 3, "d": 7})
4039

4140
# 2. New method, using format()
4241

4342
# Formatting using Positional arguments
4443
print("{0} is {1}".format("Bacon", "Awesome"))
4544
print("{0} + {1} = {2}".format(1, 2, 3))
4645
print("{0} + {1} = {3}".format(1, 2, 1, 3))
47-
print('{0}, {1}, {2}'.format('a', 'b', 'c'))
48-
print('{}, {}, {}'.format('a', 'b', 'c'))
49-
print('{2}, {1}, {0}'.format('a', 'b', 'c'))
46+
print("{0}, {1}, {2}".format("a", "b", "c"))
47+
print("{}, {}, {}".format("a", "b", "c"))
48+
print("{2}, {1}, {0}".format("a", "b", "c"))
5049

5150
# Normal formatting
5251
name = "Sherlock"
5352
print("Hello {}".format(name))
5453

5554
# Unpacking the positional values in a string
56-
print("{4} is the sum of {1} and {3}".format(*'012345'))
55+
print("{4} is the sum of {1} and {3}".format(*"012345"))
5756
print("{1}{0}{1}! You're done!".format("cad", "abra"))
5857

5958
# Aligning text

Day-003/02-lists.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Lists
44

55
# Create a list
6-
list_1 = [] # Creates an empty list using parantheses
7-
list_2 = list() # Creates an empty list using the list() builtin
6+
list_1 = [] # Creates an empty list using parantheses
7+
list_2 = list() # Creates an empty list using the list() builtin
88

99
# Lists can accomodate different/multiple data types
1010
list_2 = [1, 2, 3]
@@ -15,7 +15,7 @@
1515
list_5 = [[1, 2, 3], [5, 6, 1]]
1616

1717
# Combine a list with an existing list
18-
list_6 = list_5.__add__(list_4) # Or list_5 + list_4
18+
list_6 = list_5.__add__(list_4) # Or list_5 + list_4
1919
print(list_6)
2020

21-
# print(dir())
21+
# print(dir())

Day-004/02-tuples.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
print("tuple_2 : {0}\n".format(tuple_2))
1111

1212
# Tuples are similar to lists, but are immutable.
13-
tuple_4 = (1, 2, 3 ,4 ,5)
13+
tuple_4 = (1, 2, 3, 4, 5)
1414
print("tuple_4 : {0}".format(tuple_4))
1515
print("First element in tuple_4 : {0}".format(tuple_4[0]))
16-

Day-006/01-conditionals.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
# Example 3
2020
# Ask for an input
2121
value = input("What is the price for that thing?")
22-
value = int(value) # Try converting it to an int
22+
value = int(value) # Try converting it to an int
2323
if value < 10:
2424
print("That's great!")
2525
elif 10 <= value <= 20:
2626
print("I would still buy it!")
2727
else:
2828
print("That's costly!")
29-

Day-006/03-checking-for-nothing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@
3131
# This is an existence check, and not a content check.
3232
if empty_dict:
3333
print("Empty dict")
34-

Day-007/02-for-loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
print(range(1, 10))
1818

1919
# Looping over a dict
20-
my_dict = {"a" : 1, "b" : 2, "c" : 3}
20+
my_dict = {"a": 1, "b": 2, "c": 3}
2121
for i in my_dict.keys():
2222
print(i)
2323

2424
# Another example:
2525
for num in range(10):
2626
if num % 2 == 0:
27-
print(num)
27+
print(num)

Day-007/03-while-loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Checking for a `True` condition using `while`
1212
# will always be running.
1313

14-
#while True:
14+
# while True:
1515
# print(">>>")
1616

1717
# break
@@ -22,4 +22,4 @@
2222
print(i)
2323
if i == 5:
2424
break
25-
i += 1
25+
i += 1

Day-010/01-exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
else:
6565
print("I will run if there are no Exceptions in this code")
6666
finally:
67-
print("I am the one who will always execute! (for cleanup)")
67+
print("I am the one who will always execute! (for cleanup)")

0 commit comments

Comments
 (0)