PY1 - Python Programming Project For Beginners | Car Rental System | With Detailed Explanation - YouTube

Channel: unknown

[0]
i know you told your friend you're not
[3]
okay
[4]
and tell me what's wrong and why you
[7]
never said you felt that way
[10]
i guess you're trying to stay strong and
[12]
fake and smile until i look
[28]
as
[36]
[Music]
[43]
i don't look at anything the same way
[45]
gotta build up on my thoughts sitting in
[47]
an ashtray i'm sorry that i'm so
[49]
inconvenient okay just let me be me and
[52]
i'll stay out of your way i can see the
[54]
way you look at me i'm such a disgrace i
[57]
never really asked to be brought into
[59]
this place you wanna love me well then
[62]
baby have a taste all the highs and the
[64]
lows know you'll never be the same i
[66]
don't really wanna hurt you but i can't
[68]
control the pain if you stick it by my
[70]
side maybe we could be okay okay okay
[73]
maybe you could be the change i need
[76]
today i promise that i'm never found
[79]
this way i really hope that you will
[81]
choose
[90]
[Music]
[106]
as you fade
[111]
[Music]
[113]
you fade away
[118]
[Music]
[136]
okay
[154]
i know i'm not perfect for some
[169]
you told days friend you're not okay
[172]
and tell me what's wrong and why you
[175]
never said you felt that way
[178]
because you're trying to stay strong and
[180]
fake or smile until
[190]
as you fade
[197]
you fade away
[215]
oh
[228]
i know you told your friend you're not
[231]
okay
[232]
and tell me what's wrong why you never
[236]
said you felt that
[239]
okay way us start with the python
[241]
program
[243]
for the ide i'm using pycharm community
[247]
2021.1.2
[248]
[Music]
[250]
which is free
[251]
this year
[254]
so it's pyjama2021.1.2
[258]
community version
[267]
the name of this project is superb car
[269]
rental
[271]
and the database is csv text files
[277]
okay the program structure
[282]
in the beginning
[284]
we put all the functions at the top for
[286]
example here i have
[288]
main menu
[290]
function
[290]
[Music]
[291]
it ends here
[293]
this is one function
[296]
then goes on another function
[303]
and so on and so on all the functions
[310]
all these are functions
[323]
okay the last function is check date
[325]
rented valid this is the last function
[329]
until here
[331]
okay
[332]
so how do i call the program
[335]
i call the program by calling one of the
[339]
functions that's main menu
[341]
normally you will write all the
[343]
functions at the top you will start a
[345]
program like this to call a function now
[348]
let's go to the
[349]
main menu function
[351]
this is the main menu function
[354]
in the main menu function
[356]
we use the following controls the volume
[360]
there is this one
[362]
what is the value
[363]
with the one loop we can execute a set
[366]
of statements
[368]
as long as a condition is true
[371]
that is
[372]
here we say
[374]
index equals to 1
[375]
while index equals to 1 the program flow
[379]
will always be inside the
[382]
while loop
[384]
to get out the value
[387]
you say something like that
[393]
index equals to zero
[395]
if index equals to zero
[397]
then it will get out the while loop okay
[400]
let's do some warm-up on this one loop
[407]
let's go to the bottom of the screen
[415]
now we disable this main menu we don't
[418]
want to run this yet okay let's look at
[420]
example one let's say you want to print
[423]
a number from one to five this is how
[426]
you do it
[433]
okay
[434]
to use this value you will say
[437]
i equals to 1 in the beginning
[441]
so
[441]
while i
[443]
is less than 6
[445]
it goes on
[446]
until we come to a situation where
[449]
i
[451]
is six
[452]
if is i less than six no if it's not
[454]
then it will get get out of the program
[456]
[Music]
[458]
so we should be expecting a result
[461]
one two three four five
[463]
okay let's save the program
[466]
and let's run the program
[469]
okay when we run the program
[472]
we get the the output one two three four
[475]
five
[476]
this is what we want that's example one
[483]
that's how the wall loop works
[486]
okay let's look at example two
[489]
let's say you want the user to stay
[491]
inside the while loo
[494]
until he enters zero
[497]
okay if we start from here j equals to
[499]
one
[501]
if we want the program flow
[504]
to exit the one loop
[507]
we say j equals to zero
[509]
if j equals to zero then it will exit
[512]
the value
[516]
it says enter number
[518]
if enter 5 randomly is we are still in
[522]
the loop
[525]
if we key in
[527]
4
[530]
we are still in the loop
[532]
if we want to get out of this blue of
[534]
this one loop
[537]
we keys in zero
[545]
so those are the two examples regarding
[548]
one loop
[550]
now let's go back to the main menu
[552]
function
[553]
so the main menu functions will have
[556]
four options here
[558]
at admin user
[562]
so the main menu will have four options
[565]
here
[566]
number one admin user member customer
[569]
non-member customer exit
[572]
now if i keys in one what happened if i
[576]
keys in one it will ask for my password
[579]
i type in password three
[582]
then it will allow me to go to
[584]
admin menu
[586]
let's do that
[588]
okay i'm in the main menu
[591]
alkene one
[598]
my password is passed on to three
[605]
okay this is the admin menu
[609]
okay let's go back to the main menu
[611]
function
[617]
okay take note of this
[620]
if password equals to
[622]
pass one to three
[625]
normally
[627]
after the user keys in the password
[630]
you will check the validity by matching
[632]
user id and password from the database
[636]
in this case
[637]
we did not do the checking
[639]
because we want to make this tutorial
[642]
simple
[643]
so that the beginner python learner
[647]
is not overwhelmed with too many things
[651]
however
[652]
as you progress in this video series
[656]
you will see more examples of reading
[658]
text files
[659]
that is the database
[661]
and move on to build the project
[665]
when you as the beginning learner reach
[667]
that stage
[669]
you will have built your confidence
[672]
and skills
[673]
to take on more new concepts what you
[676]
have learned so far
[678]
all the python functions are placed in
[681]
one location
[684]
two
[685]
to start the program
[686]
you call the python function
[689]
in your example
[691]
you call main menu function
[698]
see
[699]
how to use the while loop for the menu
[701]
driven program
[703]
in your example
[704]
you allow the user to select option
[708]
in the menu driven program
[711]
the user will stay in the menu as long
[714]
as the index equals to one
[721]
here we say one index equals to one
[724]
as long as the index equals to one
[727]
the program logic will
[730]
continue to run
[732]
within the
[734]
value if you want to get out of this
[736]
value then you say
[741]
index equals to zero if index equals to
[743]
0 then you get out of the while loop for
[747]
example here i've got options 1 to 4
[751]
only
[752]
so
[753]
if the user enters 5 which is not valid
[758]
he will be confined to the value here
[761]
if the user decides to exit the program
[764]
then we say index equals zero this will
[767]
allow the program flow to exit the while
[769]
loop
[786]
okay that's all folks
[788]
if you like my video please give a
[790]
thumbs up
[792]
and subscribe to my video
[794]
see you again in the next video bye bye