Explanation:
1.6.24 start learning machine learning, mainly including some algorithm basis and how to use Octave;
2. On the evening of June 29, I began to study python.
3. On June 30, the whole day was in summer practice, and on July 1, something happened.
4. From July 2 to today's July 4, let's summarize the study in these days.
The first stage: I have a simple understanding of python, and will use cmd command prompt to write python. The following is the first stage of learning thinking map:
The second stage: learning simple python statements, according to the requirements of the topic can be programmed, and implementation.
The python statements learned at present mainly include the following:
Stage 3: Practice
(1) nesting of if conditions, as follows
message=""""Welcome to 10086 1.Call fee inquiry; 2.Traffic query; 3.Business handling; 4.Artificial services;""" print(message) index=input('Please enter the service you want to select:') index=int(index) if index==1: print('Telephone enquiry') elif index == 2: print('Traffic query') elif index==3: content="""Business management 1.Change Password; 2.Change package; 3.Shutdown;""" print(content) value=input('Please enter your business:') value = int(value) if value==1: print('Change Password') elif value == 2: print('Change packages') elif value ==3: print('Shutdown') else: print('Input error') elif index==4: print('Artificial services') else : print('Incorrect input')
(2) string format
name = input('Please enter your name:') age = input('Please enter age:') job = input('Please enter Occupation:') Hobby = input('Please enter your hobbies:') message = """ ----------- info of Alex Li ----------- Name: %s Age: %s job: %s Hobby: %s ----------------- end -----------------""" data = message %(name,age,job,Hobby,) print(data)
Operation result:
(3) user login: there are only three opportunities. Enter the correct user name and password to display the login success. Otherwise, display the user name or password error, and the remaining times are.
count = 2 while count >= 0: user = input('Please enter the user name:') password = input('Please input a password:') if user == 'alex' and password == '123456': print('Login successfully') break else: content = 'User name or password error, remaining%s Second time.' %(count,) print(content) count -= 1
(4) guessing age: guessing right, it shows that you are right; guessing wrong, there are only three opportunities, if all three guessing are wrong, ask whether to continue, if reply Y, continue to repeat the above requirements; N, end; otherwise, the input is wrong
count = 0 while True: age = input('Please enter a number:') age = int(age) count += 1 if age == 18: print('Guess right.') break elif count == 3: message = input('Whether to continue? Y/N: ') if message == 'Y': count = 0 continue elif message == 'N': print('End') else: print('Incorrect input') break else: print('Wrong guess.')
Plan:
1. Summarize the learning process once a week;
2. Strive for 3 weeks to complete the introductory study of python;
3. Be able to make upper computer before school starts