[Go] Ch1: Go Basics - 01 Go Basics

Packages (套件) 每個 Go Program 都是由套件(packages)組成的 程式運行的入口是: package main package main func main() {} Import import ( "fmt" "math" ) Exported names In Go, a name is exported if it begins with a capital letter. For example, Pi is an exported

[Python] Ch1: Python Basics - 05 Function

Function 函式 def 函式名稱(參數): 程式碼 def printf(text): print("[Out]: {}".format(text)) printf('Hello world!') [Out]: Hello world! 閏年 根據維基百科,分辨平閏年的方法為: 公元年份除以4不可整除,為平年。 公元年份除以4可整除

[Python] Ch1: Python Basics - 04 Dictionary

Dictionary 字典 在字典裡,皆由key(鍵)和value(值)組成 dict = {key1 : value1, key2 : value2 } kaka = {'firstname':'lin', 'age': 28, 'height': 175} print(kaka) {'firstname': 'lin', 'age': 28, 'height': 175} 取得 Dictionary 裡有幾個元素: len() print(len(kaka)) [Out]: 3 取得 Dictionay 裡的資

[DB] Sqlalchemy Basics

SQLAlchemy - basics SQLAlchemy - Tutorial import sqlalchemy from sqlalchemy import create_engine, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, ForeignKey, Integer, String, Numeric from sqlalchemy.orm import sessionmaker sqlalchemy.__version__ Connect Database # SQLite #connect_db = 'sqlite:///test.db' # MySQL connect_db = 'mysql+mysqldb://root:<passwd>@35.201.196.222/kaka_test' ''' create_engine 此時只有建立SQLAlchemy Engine instance(