1、 Input from keyboard 3 Number , For maximum
a = int(input(' Please enter the first number :'))
b = int(input(' Please enter the first number :'))
c = int(input(' Please enter the first number :'))
# The first one is
if a > b:
a,b = b,a # The exchange value of two numbers
if a > c:
a,b = b,c
if b > c:
b,c = c,b
print(' Maximum ',c)
# The second kind
max = 0
if a > b:
max = a
if max > c:
print(max)
else:
print(c)
else:
max = b
if max > c:
print(max)
else:
print(c)
2、 Buy a lottery , If you win the lottery 500 ten thousand , I buy a car 、 Support project hope 、 Travel to Europe , Or I'll buy a sports lottery , Keep burning Gao Xiang . Write program description .
num = input(' Please enter an eight digit number :')
if num == '12345678':
print(' I won the prize , I buy a car 、 Support project hope 、 Travel to Europe ')
else:
print(' Keep burning Gao Xiang ')
3、 When members shop , Enjoy different discounts according to different points . Calculate the discount members get when shopping . Less than 2000 hit 9 fold ,2000-4000 hit 8 fold ,4000-8000 hit 7 fold , Greater than 8000 hit 6 fold
isVip = input(' Are you a member ?(y,Y)')
money = int(input(" Your shopping amount :"))
zk = 0
if isVip == 'y' or isVip == 'Y':
if money < 2000:
zk = 0.9
if money >= 2000 and money < 4000:
zk = 0.8
if money >= 4000 and money < 8000:
zk = 0.7
if money >= 8000:
zk = 0.6
else:
zk = 1
print(' The amount of payment is :',money * zk)
4、 Menu functions Welcome to xxx System 1 Sign in 2 register 3 sign out Please select :1 Sign in
print('{:*^20}'.format(' Welcome to the student management system '))
print('1. Sign in \t2. register \t3. sign out ')
a = int(input(' Please select :'))
count = input(' Please enter your account number :')
pwd = input(' Please input a password :')
if count == '123456' and pwd == '123':
print(' Login successful ')
else:
print(' Wrong account password ')
5、 The price of air tickets is subject to the peak season 、 The impact of the off-season , First class and economy class are also different . Suppose the original price of the ticket 5000 element , Please output the actual ticket price according to the travel month and the selected position .
peak season (4-10 month ) First class 10% off economy class 20 percent discount off season First class 50% off economy class 60% off The console output is as follows : Please enter your travel month :1-12 5 Please select first class (1) Or economy class (2)? 2
Your ticket price is :4000.0
month = int(input(' Please enter the month of your trip :'))
b = int(input(' Please enter first class (1) Or economy class (2):'))
price = 5000
zk = 0
if 4 <= month and month <= 10:
if b == 1:
zk = 0.9
else:
zk = 0.8
else:
if b == 1:
zk = 0.5
else:
zk = 0.4
print(f' Your ticket price :{price * zk}')