1: Write A For loop that iterates through each character with an index
msg= ' Hello Egon 666 '
2: Write a while loop and use the index to iterate through each character
msg= ' Hello Egon 666 '
3:
msg= ' Hello Alex ' in the replacement of Alex into SB
4:
msg= '/etc/a.txt|365|get '
Cut out the file name, file size, and operation method of the character
5. Write a while loop that requires the user to enter a command, and if the command is empty, continue typing
6. Write a while loop, let the user enter the user name and password, if the user is empty or number, re-enter
7. Write the while loop, let the user enter the content, judge the input to start with Alex, then add the string _SB end
8.
1. The two-layer while loop, the outer while loop, lets the user enter a user name, password, work for several months, a monthly salary (integer), a user name or password is empty, or the number of months of work is not an integer, or
The monthly salary is not an integer, re-enter
2. Successful authentication, go to the next layer while loop, Print command prompt, query the total salary, query user identity (if the user name is Alex Print Super User, if the user name is Yuanhao or Wupeiqi
Print the normal user, the rest of the print unkown user), Exit function
3. Require user input to exit, exit all loops (using tag)
The results are as follows:
User:egon
Password:123
Work_mons:12
salary:10000
1 Total Salary Enquiry
2 Querying user identities
3 Sign Out
>>: 1
Total salary is: 120000.0
1 Total Salary Enquiry
2 Querying user identities
3 Sign Out
>>: 2
Unkown User
1 Total Salary Enquiry
2 Querying user identities
3 Sign Out
>>: 3
Python Next day homework