a page a day 3

来源:互联网 发布:宝元数控车床编程手册 编辑:程序博客网 时间:2024/06/10 15:00

last time we talk about the constant that holds something and cannot changed in the runtime process of one programm and the string ,which is said to be the most uesd constant later on . as the c/c++,we also have identifiers (in all programming languages). the rule of naming them will not appear here,for it did in c/c++.it will be boring for me to tell it .so just leave it out.

as a matter of facts ,anything python refers to is called an object.below are something ways you can do to write a programm,which is pretty COOL i think and fesible .
1. open your favorite editor ,such as vim ,gvim,emacs,notepad.
2.enter the programm you have thought over and want   to commit into paper.
3.save it as a file with the filename in the comments at the begining of your programm  . i follow the convention of .py.
4.run the programm with the command line python filename.py or use the commands  like this : chmod a+x filename.py  
        ./filename.py

so charimg!  what i will stress  here is that unlike the c/c++ ,we  need not to
declare a variable and date type . keep it in mind.
i will cp a instance(in my favorite vim):
# Filename : var.py
i=9
print i
i=i+1
print i

s='''this is wolf london
this is chrysanthemumwolf'''
print s

and i save it as var.py  and run it . it shows that:
9
10
this is wolf london
this is chrysanthemumwolf
 we have make it .
and boost a little day by day .

 

原创粉丝点击