1.1-1.13
https://www.python.org/
2.7 库和软件更多,90%公司在用
3.4
安装。都是默认
安装pycharm professional 免费30天版本
1.使用eclipse快捷键
1.create new project
2.选择2.7Python【安装后
菜单---》file---》new-project创建新的工程
score = 70 if score >=90: print("good")elif score >=80: print("well")elif score >=60: print("done")else: print("cha")
for i in range(0,100): print("item--{0}{1}".format(i,"hello"))
========================
def hello(): print("hello, python") def sayHello(name): print("hello, {0}".format(name)) hello()sayHello("chenlei") ================================================
class Hello: def __init__(self, name): self._name = name print("Hello init") def Hello(self): print("hello:{0}".format(self._name)) class Hi(Hello): def __init__(self,name): Hello.__init__(self, name) print("son init done") def sayHi(self): print("hi {0}".format(self._name)) h = Hello("chenchen")h.Hello() h1 = Hi("LEILEI")h1.sayHi() ====================引入库,文件名就是命名空间import 文件名使用: 文件名.类名 from mylib import 类名使用: 类名
#import myLibfrom myLib import Helloh = Hello()h.sayHello() =====================1.11--1.13
时间: 2024-11-10 11:38:24