自定义类:person class person { String name; int age; String sex; } 调用 person class Demo01 { public static void main(String[] args) { //创建对象 person p=new p ...
分类:
其他好文 时间:
2019-12-14 09:18:54
阅读次数:
65
""" tuple 是不可变对象 """ user_tuple = ('admin', 18, "cd", "male") print(user_tuple) # tuple 拆包 name, age, address, gender = user_tuple print(name, age, ad ...
分类:
其他好文 时间:
2019-12-13 23:22:12
阅读次数:
99
结构体是用户定义的类型,表示一系列的集合。语法为 :type关键字 结构体名字 struct{ } 1.结构体声明 type Person struct { name string sex int age int sex,age int # 由于age和sex是相同类型的字段,可以定义在同一行 } ...
分类:
其他好文 时间:
2019-12-13 21:23:44
阅读次数:
89
1.创建字典 字典中每个值都有一个唯一的key,key需要被哈希,可以是可以是数字、字符串、元组;用大括号'{}'将内容扩起来,且是无序的。 1 info = {'name':'fox','age':16,'work':'it'} 2 print(info) 3 结果: 4 {'age': 16, ...
分类:
编程语言 时间:
2019-12-13 12:13:11
阅读次数:
84
1 # Aduthor:CCIP-Ma 2 name = input("name:") 3 name2 = name 4 name = "ccip-ma" 5 age = int(input("age:")) 6 print("My name is ",name,name2) 7 info = "" ...
分类:
其他好文 时间:
2019-12-10 22:53:10
阅读次数:
153
#字典key不允许出现重复,value可以出现重复#使用大括号{}创建dict1={}dict2={"name":"李","age":"23"}#利用函数dict创建字典dict3=dict(name="李畅",sex="男")print(dict3)#dict.formkeys创建键值dict4=dict.fromkeys([‘name‘,‘sex‘,‘hiredate‘,‘grade‘])pr
分类:
编程语言 时间:
2019-12-09 18:40:23
阅读次数:
69
1、实例成员与静态成员: 在es6的类中。声明在类的构造方法中的成员称为实例成员,可以使变量或者方法,实例成员只能通过实例对象来访问。静态成员是通过类直接添加的,只能通过类来访问。 <script> class Star{ constructor(uname, age){ this.uname = ...
分类:
其他好文 时间:
2019-12-09 15:32:32
阅读次数:
205
JS的ES6 1.let let age = 12; (1). 作用: 与var类似, 用于声明一个变量 (2). 特点: 在块作用域内有效 不能重复声明 不会预处理, 不存在提升 (3). 应用: 循环遍历加监听 使用let取代var是趋势 2.const const sex = '男'; (1) ...
分类:
Web程序 时间:
2019-12-09 00:58:01
阅读次数:
116
import getpass# print("hello word")## name= 'pangxiao'# mix_name=name# print(mix_name,name)# print(2**8)# name= "pangxiao"# age=26# sex="男"# salary= 3 ...
分类:
编程语言 时间:
2019-12-08 12:29:21
阅读次数:
69
shell解析命令行 shell读取和执行命令时的大致操作过程如下图: 以执行以下命令为例: [root@localhost ~]# echo -e "some files:" ~/i* "\nThe date:$(date +%F)\n$name's age is $((a+4))" >/tmp/ ...
分类:
系统相关 时间:
2019-12-07 23:17:30
阅读次数:
114