Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b99b012

Browse files
Merge pull request avinashkranjan#2156 from idiotcommerce/master
added the decimal to hexadecimal calculator file and readme.me file f...
2 parents 5464e65 + 00887df commit b99b012

File tree

4 files changed

+69
-16
lines changed

4 files changed

+69
-16
lines changed

‎.deepsource.toml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
version = 1
22

3+
[[analyzers]]
4+
name = "shell"
5+
6+
[[analyzers]]
7+
name = "javascript"
8+
39
[[analyzers]]
410
name = "python"
5-
enabled = true
611

712
[analyzers.meta]
8-
runtime_version = "3.x.x"
9-
10-
[[transformers]]
11-
name = "autopep8"
12-
enabled = true
13+
runtime_version = "3.x.x"

‎Age_Calculator/Age_Calculator.py‎

Lines changed: 10 additions & 10 deletions
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.")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# decimal to hexa decimal converter
2+
if __name__ == "__main__":
3+
print('decimal to hexa-decimal converter using python')
4+
def decimal_to_hexadecimal():
5+
try:
6+
decimal_input = int(input("Enter a decimal number: "))
7+
hexadecimal_output = hex(decimal_input)
8+
return hexadecimal_output
9+
except ValueError:
10+
raise ValueError("Invalid input. Please enter a valid decimal number.")
11+
try:
12+
hexadecimal_number = decimal_to_hexadecimal()
13+
print(hexadecimal_number)
14+
except ValueError as e:
15+
print(str(e))
16+
17+

‎Decimal-to-hexa-decimal/readme.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
**Decimal to hexa decimal converter**
2+
3+
4+
5+
**Step1:**
6+
7+
First of all, we need to import two libraries into our code.
8+
9+
**Step2:**
10+
11+
Now, it will ask for you input decimal number
12+
13+
14+
15+
**Step3:**
16+
17+
Finally it will show the output result in hexa decimal format
18+
19+
**conclusion:**
20+
21+
It is useful to convert decimal number to hexa-decimal number
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /