Skip to content

Commit 87741e1

Browse files
author
Karandeep Grover
committed
formatted
1 parent 65a6b50 commit 87741e1

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Basics/Hindi/24_argparse/24_argparse.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ example:
77
python3 cmd.py --physics 60 --chemistry 70 --maths 90
88
```
99

10-
2. find PCM(physics chemistry maths) Merit(Average) using command line input of marks
11-
12-
```
13-
-take input
14-
-do sum of marks
15-
-take average
16-
17-
```
18-
10+
2. Find average marks for the three subjects using command line input of marks.
1911

2012

2113
[Solution](https://github.com/codebasics/py/blob/master/Basics/python_basics/24_argparse/24_argparse.py)

Basics/Hindi/24_argparse/24_argparse.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
print(args.chemistry)
1313
print(args.maths)
1414

15-
15+
print("Result:", (
16+
int(args.physics) + int(args.chemistry) + int(args.maths)
17+
) / 3)
1618

17-
print("Result:",(int(args.physics)+int(args.chemistry)+int(args.maths))/3)
18-
19-
20-
#python3 cmd.py --physics 60 --chemistry 70 --maths 90
19+
# python3 cmd.py --physics 60 --chemistry 70 --maths 90

0 commit comments

Comments
 (0)