欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

python學(xué)習(xí)之工資結(jié)算-創(chuàng)新互聯(lián)

import os,re,sys

創(chuàng)新互聯(lián)主營宜豐網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都app軟件開發(fā)公司,宜豐h5成都微信小程序搭建,宜豐網(wǎng)站營銷推廣歡迎宜豐等地區(qū)企業(yè)咨詢

operation_lists = '''
1.查詢工資
2.修改工資
3.增加新員工記錄
4.刪除員工信息
5.退出
'''
user_dict = {}
user_name = []

def user_information():
with open('info.txt','r',encoding='UTF-8') as f :
f = f.readlines()
for i in f:
i = i.strip()
i = i.split()
global user_name
user_name.append(i[0])
user_dict[i[0]] = i[1]
print(user_name)

def operation():
while True:
print(operation_lists)
user_operation = input('請(qǐng)輸入你的操作編號(hào):')
if user_operation.isdigit():
user_operation = int(user_operation)
if user_operation > 5:
print('你在搞什么,不要亂搞')
if user_operation == 1:
user_enquires()
if user_operation == 2:
salary_change()
if user_operation == 3:
add_users()
if user_operation == 4:
del_users()
if user_operation == 5:
sys.exit('退出程序')
else:
print('不要搞事情')

def user_enquires():
user_information()
name_key = input('輸入你想查詢?nèi)藛T的名字:')
global user_dict
print('%s的工資為%s'%(name_key,user_dict.get(name_key)))

def salary_change():
user_information()
name_key = input('輸入你想改變?nèi)藛T工資的名字:')
print('%s的工資為%s' % (name_key, user_dict.get(name_key)))
salary_change = input('請(qǐng)輸入該員工新的金額:')
if salary_change.isdigit():
salary_change = int(salary_change)

with open('info.txt','r',encoding='UTF-8') as fa :
       lines = fa.readlines()
   with open('info.txt','w',encoding='UTF-8') as f_w:
        for line in lines:
            if name_key in line:
                name_salay = str(user_dict.get(name_key))
                print(name_salay)
                salary_change = str(salary_change)
                line = line.replace(name_salay,salary_change)
            f_w.write(line)
        user_dict[name_key] = salary_change
        print(user_dict)
else:
    print('能不能不搞事????')

def add_users():
user_information()
user_name = input('請(qǐng)輸入你要添加人員的姓名:')
user_salary = input('請(qǐng)你給他開工資:')
if user_salary.isdigit():
user_salary = int(user_salary)
else:
print('能不能不搞事!!')
user_dict[user_name] = user_salary

def del_users():
user_information()
user_name = input('請(qǐng)輸入你要?jiǎng)h除員工的姓名:')
user_dict.pop(user_name)

operation()
#user_information()
#user_enquires()
#salary_change()
#add_users()

#user_information()

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

文章標(biāo)題:python學(xué)習(xí)之工資結(jié)算-創(chuàng)新互聯(lián)
地址分享:http://chinadenli.net/article10/cdoogo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序用戶體驗(yàn)關(guān)鍵詞優(yōu)化ChatGPT企業(yè)建站全網(wǎng)營銷推廣

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營