1
00:00:01,110 --> 00:00:02,460
All right, congratulations!

2
00:00:02,460 --> 00:00:05,970
You've got yourself a job at Python Pizza.

3
00:00:05,970 --> 00:00:09,870
So your first job as a programmer at Python Pizza

4
00:00:09,870 --> 00:00:13,380
is to build an automatic Pizza Order Program.

5
00:00:13,380 --> 00:00:16,110
That is the goal of this exercise.

6
00:00:16,110 --> 00:00:18,360
Take a look at the starting code.

7
00:00:18,360 --> 00:00:23,340
You'll see that the user can put in the size that they want,

8
00:00:23,340 --> 00:00:25,680
whether if they want to add pepperoni

9
00:00:25,680 --> 00:00:28,590
and whether if they want extra cheese.

10
00:00:28,590 --> 00:00:32,670
Based on the user input for these three criteria,

11
00:00:32,670 --> 00:00:36,060
we're going to work out what is the price of their pizza.

12
00:00:36,060 --> 00:00:38,310
If you look inside the description box

13
00:00:38,310 --> 00:00:40,950
you'll see the different modifiers.

14
00:00:40,950 --> 00:00:44,340
Starting with the size, we have different prices

15
00:00:44,340 --> 00:00:46,830
for small, medium, and large.

16
00:00:46,830 --> 00:00:50,010
And then if somebody wants to add pepperoni

17
00:00:50,010 --> 00:00:53,437
that's an extra $2 to a small pizza,

18
00:00:53,437 --> 00:00:56,640
$3 for a medium or large pizza.

19
00:00:56,640 --> 00:01:00,000
And finally, if you want to add extra cheese for any pizza

20
00:01:00,000 --> 00:01:03,000
that's just a single extra dollar.

21
00:01:03,000 --> 00:01:05,280
If you take a look at the example input

22
00:01:05,280 --> 00:01:06,810
where we've got a large pizza

23
00:01:06,810 --> 00:01:11,810
where they want "Yes" to pepperoni and "No" to extra cheese,

24
00:01:12,420 --> 00:01:16,140
then the example output is as follows.

25
00:01:16,140 --> 00:01:18,300
"Thank you for choosing Python Pizza Deliveries!

26
00:01:18,300 --> 00:01:21,630
"Your final bill is: $28."

27
00:01:21,630 --> 00:01:23,880
Now remember, the first line of that output

28
00:01:23,880 --> 00:01:26,130
is already printed for you in line 1, 

29
00:01:26,130 --> 00:01:27,930
so you don't need to worry about that.

30
00:01:27,930 --> 00:01:30,630
All you need to figure out is how to build the program

31
00:01:30,630 --> 00:01:33,480
so that it prints out, "Your final bill is",

32
00:01:33,480 --> 00:01:35,700
and then calculates the correct value

33
00:01:35,700 --> 00:01:37,680
based on the user input.

34
00:01:37,680 --> 00:01:40,710
And the user input is just going to be a bunch of letters.

35
00:01:40,710 --> 00:01:44,370
So the first input is going to come in for the size,

36
00:01:44,370 --> 00:01:45,510
S, M or L.

37
00:01:45,510 --> 00:01:48,060
The second one is going to be Y or N,

38
00:01:48,060 --> 00:01:51,120
and the third one is also going be Y or N.

39
00:01:51,120 --> 00:01:52,770
Pause, have a think about this,

40
00:01:52,770 --> 00:01:54,780
apply your knowledge of conditionals,

41
00:01:54,780 --> 00:01:57,123
and see if you can complete this exercise.

42
00:02:05,490 --> 00:02:07,410
Alright, so the first thing we're going to do

43
00:02:07,410 --> 00:02:10,590
is we're going to create a variable called "bill"

44
00:02:10,590 --> 00:02:15,590
to keep track of the ongoing price of their pizza.

45
00:02:16,050 --> 00:02:20,640
We can start that bill at $0 and then we can proceed.

46
00:02:20,640 --> 00:02:24,480
The next part of our code checks for the first condition,

47
00:02:24,480 --> 00:02:29,480
which is whether if their first input was S, M, or L,

48
00:02:30,330 --> 00:02:32,460
and we can use an if, elif, else,

49
00:02:32,460 --> 00:02:34,560
or we can use three if statements.

50
00:02:34,560 --> 00:02:36,810
You can do it in many ways,

51
00:02:36,810 --> 00:02:38,580
but essentially we're checking to see

52
00:02:38,580 --> 00:02:40,620
if they put an input of S,

53
00:02:40,620 --> 00:02:42,660
then we're going to add $15 to the bill.

54
00:02:42,660 --> 00:02:45,330
If they put an input of M on the first line,

55
00:02:45,330 --> 00:02:46,620
then we're going to add 20.

56
00:02:46,620 --> 00:02:51,510
And if the last condition, or we want to check if it was L,

57
00:02:51,510 --> 00:02:54,033
then we can add $25.

58
00:02:55,860 --> 00:02:58,680
Now the next condition is whether if they wanted pepperoni

59
00:02:58,680 --> 00:02:59,880
on their pizza,

60
00:02:59,880 --> 00:03:01,980
and if the answer is yes,

61
00:03:01,980 --> 00:03:05,730
then we have to check against the size that they ordered.

62
00:03:05,730 --> 00:03:09,030
If the size was medium or large,

63
00:03:09,030 --> 00:03:11,250
we're going to add $3 to their bill,

64
00:03:11,250 --> 00:03:14,460
and if it was small, then we're going to add only $2.

65
00:03:14,460 --> 00:03:16,740
So you could have used a combination.

66
00:03:16,740 --> 00:03:19,170
So you could have said if size == "M"

67
00:03:19,170 --> 00:03:20,790
and size == "L",

68
00:03:20,790 --> 00:03:23,010
but in this case, what I've done is simply checked

69
00:03:23,010 --> 00:03:25,860
for just the single statement, which is unique.

70
00:03:25,860 --> 00:03:27,900
If the size is small, then add two.

71
00:03:27,900 --> 00:03:31,140
In all other conditions, add three.

72
00:03:31,140 --> 00:03:33,420
Final condition is probably the easiest.

73
00:03:33,420 --> 00:03:37,500
We simply want to check is the last input is "Yes"

74
00:03:37,500 --> 00:03:40,380
in this case, we just add $1 to the bill.

75
00:03:40,380 --> 00:03:42,600
And all of these things added up

76
00:03:42,600 --> 00:03:46,230
will eventually create the final price for the pizza.

77
00:03:46,230 --> 00:03:50,190
And we can print out that final price using an f-string

78
00:03:50,190 --> 00:03:54,510
by inserting the bill into the print statement,

79
00:03:54,510 --> 00:03:57,330
and make sure that you've got all your punctuation,

80
00:03:57,330 --> 00:04:00,960
your full stops, everything matching exactly what it says

81
00:04:00,960 --> 00:04:01,950
in the description,

82
00:04:01,950 --> 00:04:04,140
otherwise, the tests won't pass.

83
00:04:04,140 --> 00:04:05,880
But otherwise, all going well,

84
00:04:05,880 --> 00:04:09,210
you should be able to submit your code solution

85
00:04:09,210 --> 00:04:12,783
and it should show as passed for all conditions.

