3) a. Conditional Statements Examples (2)

Bates is the world’s richest man. He can only accept the money deposited to his bank account if the deposit exceeds 1,000,000 USD. As the country’s leading computer programs developer, you’ve been tasked by Bates’ bank to create a python code snippet that reads inputs to Bates’ bank account and prints either “accept” or “reject” depending on the input amount. Show them how it’s done.

1
2
3
Output:
How much do you want to deposit to Bates? (in figures)  50000
Rejected!




Bates, the richest guy, has a little problem at his private gate entrance. He’s bought a new, programmable security tool that needs to accept entry for him and his wife Tia. He’s reached out to you to develop a python code that will accept the secret code “Tia” or “Bates” as entry codes. How will you do it?

1
2
3
Output:
Enter your secret code here:  Bates
Code is accepted.




Bates has just invited you to his grand end-year party! A billionaires’ only party. Gulp. As a way to pay for your billion-worth ticket, you will have to develop a new python program code that is to be used at the party’s entry gate. This new code will take people’s names and only deny entry to Gate’s worst enemies: Gaga, Gege, and Gigi. Develop the code now.

1
2
3
4
Output:
You are at the billionaire's party entrance
So, what is your name? :  Gaga
gaga, your access to the Billionaire'
s party is denied!




You’ve just discovered that your crazy ex-girlfriend, wants to gain an unsolicited ticket to the billionaire’s party using an alias name. Luckily, she cannot use a fake phone number. You’re determined to deny her entry. Add code that will request for every guest’s phone number and deny entry to her phone number: 11-223-3344.

1
2
3
4
5
6
Output:
You are at the billionaire's party entrance
Ummh. So, what is your name? :  Susan
You'
re just one step away. We need one more thing...
Tell us your phone number :  11-223-3344
susan, your access to the Billionaire's party is denied!




It’s been established that Bates loves being with people whose phone numbers contain “5”s as 5 is his lucky number. Your role here is to develop a python code snippet that accepts a person’s phone number and offers a VIP seat if his phone number contain “5”. Write a code that will help to select the VIPs.

1
2
3
4
5
6
7
8
9
10
Output:
You're about to try a lottery to win one of the 10 VIP seats at the party
Tell us your phone number to help our oracle in dermining your luck :  3345

 ==: Congratulations! You'
ve won VIP seat number 1. :==

You're about to try a lottery to win one of the 10 VIP seats at the party
Tell us your phone number to help our oracle in dermining your luck :  3726

 Good try. But you will just take the ordinary seats.