5393| 2
|
[项目分享] 一个DOS模拟器 |
1 创造力 | 回复本帖可获得 1 创造力奖励! 每人限 1 次 |
[ 本帖最后由 RYAN 于 2022-6-5 12:26 编辑 ]\n\nimport time c = ['POS' , '附件'] fj = ['Calculator' , 'dog zero calculation' , 'Judge Leap Year'] print('Welcome to this operating system') time.sleep(4) print('Appendices:Calculator, dog zero calculation, Judge Leap Year') while 1: ram = input('>>>') if ram == fj[0]: a = input('Enter A to power, enter B to close the calculator, enter C to multiply:') if a != 'A' and a != 'C' and a != 'B': print('TAT\n Invalid input \nTAT') elif a == 'A' : a = float(input('Please enter the first number:')) b = float(input('Please enter the second number:')) c = a**b c = str(c) print('Equal to'+c) elif a == 'C' : a = float(input('Please enter the first number:')) b = float(input('Please enter the second number:')) print('Equal to' , a*b) else: print('out') break elif ram == fj[1]: j = int(input('How old is the dog:')) if j <= 0 : print('That’s not possible') elif j == 1 : print('The equivalent of 14 years old') elif j == 2 : print('The equivalent of 22 years old') else: h = (j+22)*2 print('The equivalent of' , h , 'years old') elif ram == fj[2]: n = int(input('Please enter a year:')) if n % 4 == 0 and n % 100 != 0 or n % 400 == 0: print('{0}year, is a leap year.'.format(n)) else: print('{0}year, not leap year.'.format(n)) else: print('Invalid input') |
© 2013-2025 Comsenz Inc. Powered by Discuz! X3.4 Licensed