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 7aa8f04

Browse files
ticket booking withpython
1 parent 18fa58d commit 7aa8f04

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎ticket_booking.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# You are provided price of three different types of ticket: 1st Class, 2nd class and 3rd class.
2+
3+
# Also, you know the number of tickets of each type you need to book. Find total cost you need to pay.
4+
5+
# 1200 1400 2000
6+
# 5 6 2
7+
8+
9+
cost = input()
10+
cost = list(map(int, cost.split(' ')))
11+
quantity = input()
12+
quantity = list(map(int, quantity.split(' ')))
13+
14+
total = (cost[0] * quantity[0]) + (cost[1] * quantity[1]) + (cost[2] * quantity[2])
15+
print(total)
16+
17+
# Tset cases
18+
# https://oj.masaischool.com/status/94c317dde26b7488a9081e03973e4528

0 commit comments

Comments
(0)

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