jack0he的个人博客分享 http://blog.sciencenet.cn/u/jack0he

博文

按标题搜索
Python-Note-8-data structure-lists (continue)
2017-4-12 04:58
Using for loops with lists Example-1 animal= for i in animal: print('The animal is '+i) --- outPut The animal is cat The animal is dog The animal is fish The animal is elephant Is a specific value in a list? 'cat' in animal outP ...
个人分类: Python 笔记|2401 次阅读|没有评论
Python-note-7-data structure-lists
2017-4-12 02:21
Data structures: 1, numbers 2, strings, 3, lists, 4, tuples, 5, dictionaries This part concerns the list data type. A list is a vector contains multiple values, including numbers, strings and/or lists. Differing from Matlab in which the elements are bracketed by (), Python brackets the ...
个人分类: Python 笔记|2329 次阅读|没有评论
Python-Note-6-Global and local variables
2017-4-11 17:56
a global variable is always defined in the main function while a local one is defined in a non-main function. A global variable can be used in either the main function or the non-main function. However, the local variable can only be used in the defined function and can not be used in ...
个人分类: Python 笔记|1962 次阅读|没有评论
Python -Note-5-for-statements
2017-4-11 03:55
for: iterate a clause over the items of any sequence. The sequence can be a set of numbers or strings. Example-1 words= for w in words: print('Hello, '+w) --- outPut: Hello, cat Hello, mice Hello, rabbit Example-2 for i in range ...
个人分类: Python 笔记|2094 次阅读|没有评论
Python-Note-4-Continue-statements
2017-4-11 01:59
Continue statements If the continue function is executed, go back to the start of the clause of the while loop. Example: while True: print('please type your name') name=input() if name!='Jack': contin ...
个人分类: Python 笔记|2095 次阅读|没有评论
Python-Note-3-break-while-loop
2017-4-10 23:00
break statements Function: break while loop. If the break statement is executed, the while loop is terminated. Example Code in Pytho-Note-2-while loop name='' while name!='your name': print('please type your name') name=input() prin ...
个人分类: Python 笔记|2159 次阅读|没有评论
Python-Note-2-While-loop-statements
2017-4-10 21:50
While loop while loop in Python while condition: clause Example a=1 b=0 while a5: b=a+b a=a+1 print('the sum is ' +str(a)) while loop in Matlab while condition clause; end Example a=1; b=0 ...
个人分类: Python 笔记|1931 次阅读|没有评论
Python-Note-1-If-else-statements
2017-4-10 17:47
1, If statements if condition: xxxx Example: name='alibaba' if name=='alibaba': print('My name is alibaba') 2, else statements Example: name='alibaba' if name=='alibaba': print('My name is al ...
个人分类: Python 笔记|2111 次阅读|没有评论
matlab-plotyy
2017-2-14 19:47
=plotyy(t,belt.import*2000,t,belt.speed); xlim(hAx(1), ); xlim(hAx(2), ); % set(hAx,'linewidth',1.5) set(hLine1,'linewidth',1.5); set(hLine2,'linewidth',1.5,'linestyle',':'); ylabel(hAx(1),'Loading rate ','FontSize',10); ylabel(hAx ...
2040 次阅读|没有评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 16:12

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部