2016-07-01から1ヶ月間の記事一覧

python勉強メモ: strings

string concatenation str1 = "hello" str2 = "mike" str3 =str1+str2 print str3 実行結果: hellomike +記号は文字列を繋げる。 raw_input()で取得したものは文字列になる。数字に変換するにはfloat()かint()を使う。 square brackets[]から文字列から一個…

coursera python

try and except you surround a dangerous section of code with try and except. if the code in the try works- the except is skipped if the code in the try fails- it jumps to the except section is Python has an “is” operator that can be used i…