Skip to content

Commit 1ea3763

Browse files
committed
Fix code style issues with Black
1 parent 6fb83fa commit 1ea3763

File tree

8 files changed

+71
-78
lines changed

8 files changed

+71
-78
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
# Problem name: add_10
2+
# A messy teacher named Bob would like to add 10 points to each student’s recent test score.
3+
# There are four students, and going from highest score to lowest score, it is Mike, Dan, Stan, and Ban.
4+
# Add 10 to each score and assign those values to the correct student.
5+
# Solve this problem by adding no more than 2 lines of code.
6+
# Hint: Use tuple unpacking and list comprehension.
17

2-
#Problem name: add_10
3-
#A messy teacher named Bob would like to add 10 points to each student’s recent test score.
4-
#There are four students, and going from highest score to lowest score, it is Mike, Dan, Stan, and Ban.
5-
#Add 10 to each score and assign those values to the correct student.
6-
#Solve this problem by adding no more than 2 lines of code.
7-
#Hint: Use tuple unpacking and list comprehension.
8-
9-
#the scores are given
8+
# the scores are given
109
scores = (100, 90, 80, 70)
1110

12-
#write your code below
11+
# write your code below
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#Problem name: even_words
2-
#Given a string that the user inputs create a list that contains the square of the lengths of words with an even amount of characters.
3-
#For example, if the string is “I am cool”, the list would be [4, 16].
4-
#Use a list comprehension to solve it.
1+
# Problem name: even_words
2+
# Given a string that the user inputs create a list that contains the square of the lengths of words with an even amount of characters.
3+
# For example, if the string is “I am cool”, the list would be [4, 16].
4+
# Use a list comprehension to solve it.
55

6-
#the user inputs the string
6+
# the user inputs the string
77
string = input()
88

9-
#write your code below
9+
# write your code below
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#Problem name: odd_squares
2-
#Given a list of integers, create a list of all the squares of the odd integers within the list.
3-
#Use a list comprehension to solve it.
1+
# Problem name: odd_squares
2+
# Given a list of integers, create a list of all the squares of the odd integers within the list.
3+
# Use a list comprehension to solve it.
44

5-
#the given code takes an input and makes it a list of numbers
6-
#for example, entering “1 23 4” as the input will result in the list [1,23,4]
5+
# the given code takes an input and makes it a list of numbers
6+
# for example, entering “1 23 4” as the input will result in the list [1,23,4]
77
ex_list = input().split()
88
for idx in range(len(ex_list)):
9-
ex_list[idx] = int(ex_list[idx])
10-
11-
#write your code below
9+
ex_list[idx] = int(ex_list[idx])
1210

11+
# write your code below
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#Problem Name: square_root_list
2-
#Take a user given list of numbers and make a list of all the square roots of the numbers using list comprehension.
3-
#Use a list comprehension to solve it.
4-
#Hint: The square root of a number is the same as taking the ½ power of a number.
1+
# Problem Name: square_root_list
2+
# Take a user given list of numbers and make a list of all the square roots of the numbers using list comprehension.
3+
# Use a list comprehension to solve it.
4+
# Hint: The square root of a number is the same as taking the ½ power of a number.
55

6-
#the given code takes an input and makes it a list of numbers
7-
#for example, entering “1 23 4” as the input will result in the list [1,23,4]
6+
# the given code takes an input and makes it a list of numbers
7+
# for example, entering “1 23 4” as the input will result in the list [1,23,4]
88
ex_list = input().split()
99
for idx in range(len(ex_list)):
10-
ex_list[idx] = int(ex_list[idx])
10+
ex_list[idx] = int(ex_list[idx])
1111

12-
#write your code below
12+
# write your code below
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
# Problem name: update_score
2+
# A hacker named Dan wishes to hack into a competition where they judge participants in three categories on a scale of 10.
3+
# Dan wants his friend Bob to win.
4+
# Bob will only win if he has all 10s while the other competitors, Jo and Stan, don’t.
15

2-
#Problem name: update_score
3-
#A hacker named Dan wishes to hack into a competition where they judge participants in three categories on a scale of 10.
4-
#Dan wants his friend Bob to win.
5-
#Bob will only win if he has all 10s while the other competitors, Jo and Stan, don’t.
6+
# Judges will store the scoring within a tuple ([...], [...], [...]).
7+
# The scores before Dan hacked are given.
8+
# Bob will be located as the first person the judges scored and will have the lowest points out of any participant.
9+
# Create a program to help Dan help Bob win.
10+
# Also, print Bob’s score at the end.
11+
# Use tuple unpacking to solve this problem.
612

7-
#Judges will store the scoring within a tuple ([...], [...], [...]).
8-
#The scores before Dan hacked are given.
9-
#Bob will be located as the first person the judges scored and will have the lowest points out of any participant.
10-
#Create a program to help Dan help Bob win.
11-
#Also, print Bob’s score at the end.
12-
#Use tuple unpacking to solve this problem.
13+
# the scores are given
14+
scores = ([1, 1, 1], [2, 2, 2], [3, 3, 3])
1315

14-
#the scores are given
15-
scores = ([1,1,1] , [2,2,2], [3,3,3])
16-
17-
#write your code below
16+
# write your code below
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
# Problem name: add_10
2+
# A messy teacher named Bob would like to add 10 points to each student’s recent test score.
3+
# There are four students, and going from highest score to lowest score, it is Mike, Dan, Stan, and Ban.
4+
# Add 10 to each score and assign those values to the correct student.
5+
# Solve this problem by adding no more than 2 lines of code.
6+
# Hint: Use tuple unpacking and list comprehension.
17

2-
#Problem name: add_10
3-
#A messy teacher named Bob would like to add 10 points to each student’s recent test score.
4-
#There are four students, and going from highest score to lowest score, it is Mike, Dan, Stan, and Ban.
5-
#Add 10 to each score and assign those values to the correct student.
6-
#Solve this problem by adding no more than 2 lines of code.
7-
#Hint: Use tuple unpacking and list comprehension.
8-
9-
#the scores are given
8+
# the scores are given
109
scores = (100, 90, 80, 70)
1110

12-
#write your code below
11+
# write your code below
1312
scores_added = [n + 10 for n in scores]
1413
Mike, Dan, Stan, Ban = scores_added
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#Problem name: odd_squares
2-
#Given a list of integers, create a list of all the squares of the odd integers within the list.
3-
#Use a list comprehension to solve it.
1+
# Problem name: odd_squares
2+
# Given a list of integers, create a list of all the squares of the odd integers within the list.
3+
# Use a list comprehension to solve it.
44

5-
#the given code takes an input and makes it a list of numbers
6-
#for example, entering “1 23 4” as the input will result in the list [1,23,4]
5+
# the given code takes an input and makes it a list of numbers
6+
# for example, entering “1 23 4” as the input will result in the list [1,23,4]
77
ex_list = input().split()
88
for idx in range(len(ex_list)):
9-
ex_list[idx] = int(ex_list[idx])
10-
11-
#write your code below
12-
odds_quares = [n**2 for n in list if n%2 == 1]
9+
ex_list[idx] = int(ex_list[idx])
1310

11+
# write your code below
12+
odds_quares = [n ** 2 for n in list if n % 2 == 1]
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1+
# Problem name: update_score
2+
# A hacker named Dan wishes to hack into a competition where they judge participants in three categories on a scale of 10.
3+
# Dan wants his friend Bob to win.
4+
# Bob will only win if he has all 10s while the other competitors, Jo and Stan, don’t.
15

2-
#Problem name: update_score
3-
#A hacker named Dan wishes to hack into a competition where they judge participants in three categories on a scale of 10.
4-
#Dan wants his friend Bob to win.
5-
#Bob will only win if he has all 10s while the other competitors, Jo and Stan, don’t.
6+
# Judges will store the scoring within a tuple ([...], [...], [...]).
7+
# The scores before Dan hacked are given.
8+
# Bob will be located as the first person the judges scored and will have the lowest points out of any participant.
9+
# Create a program to help Dan help Bob win.
10+
# Also, print Bob’s score at the end.
11+
# Use tuple unpacking to solve this problem.
612

7-
#Judges will store the scoring within a tuple ([...], [...], [...]).
8-
#The scores before Dan hacked are given.
9-
#Bob will be located as the first person the judges scored and will have the lowest points out of any participant.
10-
#Create a program to help Dan help Bob win.
11-
#Also, print Bob’s score at the end.
12-
#Use tuple unpacking to solve this problem.
13+
# the scores are given
14+
scores = ([1, 1, 1], [2, 2, 2], [3, 3, 3])
1315

14-
#the scores are given
15-
scores = ([1,1,1] , [2,2,2], [3,3,3])
16-
17-
#write your code below
16+
# write your code below
1817
scores[0][0] = 10
1918
scores[0][1] = 10
2019
scores[0][2] = 10
2120
(Bob, Jo, Stan) = scores
2221
print(Bob)
23-

0 commit comments

Comments
 (0)