I can't be bothered to make a video explanation of this, so have chatGPT explain it for you :3
flowchart TD
a([start]) --> b[/input payment_mode/]
b --> d[/print menu/]
d --> c{payment_mode<br>is 1?}
c --> |yes| e[/input items_num/]
e --> ah((a))
ag((a)) --> f{items_num<br>is 1?}
f --> |yes| g[/input menu_item/]
g --> h{menu_item<br>an int?}
h --> |yes| i["balance = balance - menu[menu_item]"]
i --> j[/print You ordered.../]:::success
j --> l
h --> |no| k[/print Please choose.../]:::error
k --> l([end])
f --> |no| u{items_num<br>is 2?}
u --> |yes| m[/input menu_item_1/]
m --> n{menu_item_1<br>an int?}
n --> |yes| o[/input menu_item_2/]
o --> p{menu_item_2<br>an int?}
p --> |yes| q["balance = balance -<br>(menu[menu_item_1] +<br>menu[menu_item_2])"]
q --> r[/print You ordered.../]:::success
r --> l
p --> |no| t[/print Please choose.../]:::error
t --> l
n --> |no| s[/print Please choose.../]:::error
s --> l
u --> |no| v[/print Sorry, you.../]:::error
v --> l
c --> |no| w{payment_mode<br>is 2?}
w --> |yes| x[/input load_hmm/]
x --> y{load_hmm<br>is 1?}
y --> |yes| z[/input load_amt/]
z --> aa{load_amt<br>is int?}
aa --> |yes| ab[/print Current balance.../]
ab --> e
aa --> |no| ac[/print load_amt is not valid.../]:::error
ac --> l
y --> |no| ae
w --> |no| ad{payment_mode<br>is 3?}
ad --> |yes| ae[/print Thank you!/]:::success
ae --> l
ad --> |no| af[/print payment_mode is not valid/]:::error
af --> l
classDef success color:#83ce9e,stroke:#6fc890
classDef error color:#f3626b,stroke:#f14652