Skip to content

Commit 3b1baee

Browse files
committed
properly aligned the intendentation 2 from 4 spaces
1 parent 0bf4b5c commit 3b1baee

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

Age_Calculator/Age_Calculator.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ def calculate_age(birthday):
1717
return age_string
1818

1919
if __name__ == "__main__":
20-
print(" Age Calculator By Python")
20+
print(" Age Calculator By Python")
2121

22-
try:
23-
birthYear = int(input("Enter the birth year: "))
24-
birthMonth = int(input("Enter the birth month: "))
25-
birthDay = int(input("Enter the birth day: "))
26-
dateOfBirth = date(birthYear, birthMonth, birthDay)
27-
age = calculate_age(dateOfBirth)
28-
print(age)
29-
except ValueError:
30-
print("Invalid input. Please enter valid integers for the year, month, and day.")
22+
try:
23+
birthYear = int(input("Enter the birth year: "))
24+
birthMonth = int(input("Enter the birth month: "))
25+
birthDay = int(input("Enter the birth day: "))
26+
dateOfBirth = date(birthYear, birthMonth, birthDay)
27+
age = calculate_age(dateOfBirth)
28+
print(age)
29+
except ValueError:
30+
print("Invalid input. Please enter valid integers for the year, month, and day.")
+7-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# decimal to hexa decimal converter
2-
32
if __name__ == "__main__":
43
print('decimal to hexa-decimal converter using python')
54
def decimal_to_hexadecimal():
65
try:
7-
decimal_input = int(input("Enter a decimal number: "))
8-
hexadecimal_output = hex(decimal_input)
9-
return hexadecimal_output
6+
decimal_input = int(input("Enter a decimal number: "))
7+
hexadecimal_output = hex(decimal_input)
8+
return hexadecimal_output
109
except ValueError:
11-
raise ValueError("Invalid input. Please enter a valid decimal number.")
12-
10+
raise ValueError("Invalid input. Please enter a valid decimal number.")
1311
try:
14-
hexadecimal_number = decimal_to_hexadecimal()
15-
print(hexadecimal_number)
12+
hexadecimal_number = decimal_to_hexadecimal()
13+
print(hexadecimal_number)
1614
except ValueError as e:
17-
print(str(e))
15+
print(str(e))
1816

1917

0 commit comments

Comments
 (0)