#class use import myclass pr = myclass.Customer("鈴木", 23, "*****@*****.**", "123-456-7890") nm = pr.getName() ag = pr.getAge() ad = pr.getAdr() tl = pr.getTel() print(nm, "さんは", ag, "才です。") print("アドレスは", ad, "電話番号は", tl, "です。")
import myclass as my pr = my.Customer("鈴木", 55, "*****@*****.**", "0123-45-6789") name = pr.getName() age = pr.getAge() address = pr.getAdr() tel = pr.getTel() print(name, "さんは", age, "歳です") print("アドレスは", address, "電話番号は", tel)
import myclass cs = myclass.Customer("小明", 20, "*****@*****.**", "0912345678") nm = cs.getName() ag = cs.getAge() ml = cs.getMail() tl = cs.getTel() print(nm, "先生/小姐", ag, "歲") print("E-mail:", ml, "手機號碼:", tl)
import myclass pr = myclass.Customer("鈴木", 23, "*****@*****.**", "xxx-xxx-xxxx") nm = pr.getName() ag = pr.getAge() ad = pr.getAdr() tl = pr.getTel() print(nm, "さんは", ag, "才です。") print("アドレスは", ad, "電話番号は", tl, "です。")
import myclass pr = myclass.Customer('鈴木 ', 33, 'sample@example', '0123-45-6789') nm = pr.getName() ag = pr.getAge() ad = pr.getAdr() tl = pr.getTel() print(f"{nm}さんは{ag}歳です") print(f"アドレスは{ad}、電話番号は{tl}です")