Skip to content

Commit c36435b

Browse files
committed
fix some codes
1 parent 8abd8e0 commit c36435b

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

week-2/camel/camel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
in_put = input("camelCase: ").strip()
1111

12+
print("snake_case: ", end="")
1213
for char in in_put:
1314
if(char.isupper()):
1415
print("_",end="")
1516
print(char.lower(),end="")
1617

17-
print("")
18+
print()

week-2/nutrition/nutrition.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111

12-
#defind a doctionary for keep all fruits name and calories
12+
# defind a doctionary for keep all fruits name and calories
1313
fruits={
1414
'apple':'130',
1515
'avocado':'50',
@@ -38,4 +38,5 @@
3838
in_put = input("Item: ").lower()
3939
if in_put not in fruits:
4040
exit(0)
41-
print(f'Calories: {fruits[in_put]}')
41+
else:
42+
print(f'Calories: {fruits[in_put]}')

week-2/plates/plates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def is_valid(s):
4444
# if first number is not 0 so just break
4545
tempo = s[one:]
4646
break
47-
if temp != " ":
47+
if tempo != " ":
4848
resault = end_str(tempo)
4949
if resault != True:
5050
return False

week-2/twttr/twttr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313

1414
for let in user:
1515
if (let.upper() in ['A', 'E', 'I', 'O', 'U']):
16+
# skip this round
1617
continue
17-
print(let,end="")
18+
else:
19+
# print corrent character
20+
print(let, end="")
1821

1922
# print new line
20-
print("")
23+
print()

week-3/fuel/fuel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
# infinity loop
1313
while True:
14-
1514
try:
1615
# if x and y cannot ba convert to int then
1716
# except pass this round
1817
user = input("Fraaaction: ")
1918
one,two = user.split("/")
20-
one =int(one)
19+
one = int(one)
2120
two = int(two)
2221
if one > two:
2322
continue

week-3/grocery/grocery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# if in the dic we increment it
2121
temp_list[user] += 1
2222

23+
# when user click Ctrl+Z
2324
except EOFError:
2425

2526
# first iterate in each k,v in dictionary

week-3/outdated/outdated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# pass this round
4141
continue
4242
# if month input is greater than 12
43-
if m > 12 or m < 1:
43+
if( m > 12 or m < 1):
4444
# pass this round
4545
continue
4646
if y < 999:

0 commit comments

Comments
 (0)