摘要: 一.下载Android studio https://developer.android.google.cn/studio/ 二.安装 首先移动 弹出下面弹框,直接点击OK 提示无法访问Android SDK,直接cancel 弹出如下界面,直接next 选择标准模式,点击next 接下来弹出ui主 阅读全文
posted @ 2018-11-19 23:02 anobscureretreat 阅读(451) 评论(0) 推荐(0)
摘要: myDict = {'a':1,'b':2,'c':3,'d':4} print(myDict) if 'a' in myDict: del myDict['a'] print(myDict) 阅读全文
posted @ 2018-11-19 20:46 anobscureretreat 阅读(203) 评论(0) 推荐(0)
摘要: def is_vowel(char): all_vowels = 'aeiou' return char in all_vowels print(is_vowel('c')) print(is_vowel('e')) 阅读全文
posted @ 2018-11-19 20:12 anobscureretreat 阅读(2960) 评论(0) 推荐(0)
摘要: # Python program to convert decimal number into binary, octal and hexadecimal number system # Change this line for a different result dec = 344 print("The decimal value of",dec,"is:") print(bin(d... 阅读全文
posted @ 2018-11-19 20:02 anobscureretreat 阅读(178) 评论(0) 推荐(0)
摘要: def convertToBinary(n): """Function to print binary number for the input decimal using recursion""" if n > 1: convertToBinary(n//2) print(n % 2,end = '') # decimal number dec = ... 阅读全文
posted @ 2018-11-19 19:58 anobscureretreat 阅读(1360) 评论(0) 推荐(0)
摘要: # Program to generate a random number between 0 and 9 # import the random module import random print(random.randint(0,9)) 阅读全文
posted @ 2018-11-19 19:54 anobscureretreat 阅读(176) 评论(0) 推荐(0)
摘要: import platform import os print(os.name) print(platform.system()) print(platform.release()) 阅读全文
posted @ 2018-11-19 19:52 anobscureretreat 阅读(256) 评论(0) 推荐(0)
摘要: from datetime import date f_date = date(2014, 7, 2) l_date = date(2014, 7, 11) delta = l_date - f_date print(delta.days) 阅读全文
posted @ 2018-11-19 19:47 anobscureretreat 阅读(1131) 评论(0) 推荐(1)
摘要: # For 32 bit it will return 32 and for 64 bit it will return 64 import struct print(struct.calcsize("P") * 8) 阅读全文
posted @ 2018-11-19 19:43 anobscureretreat 阅读(621) 评论(0) 推荐(0)
摘要: import os # Access all environment variables print('*---------------ENVIRON-------------------*') print(os.environ) print('*----------------HOME------------------*') # Access a particula... 阅读全文
posted @ 2018-11-19 19:41 anobscureretreat 阅读(4605) 评论(0) 推荐(0)
摘要: class Rectangle(): def __init__(self, l, w): self.length = l self.width = w def rectangle_area(self): return self.length*self.width newRectangle =... 阅读全文
posted @ 2018-11-19 19:36 anobscureretreat 阅读(266) 评论(0) 推荐(0)
摘要: 新建test.py 运行 然后查看当前目录的runtest.log,会看到下面的结果 阅读全文
posted @ 2018-11-19 18:29 anobscureretreat 阅读(137) 评论(0) 推荐(0)
摘要: my_dict = {'data1':100,'data2':-54,'data3':247} result=1 for key in my_dict: result=result * my_dict[key] print(result) 阅读全文
posted @ 2018-11-19 10:30 anobscureretreat 阅读(1572) 评论(0) 推荐(0)
摘要: keys = ['red', 'green', 'blue'] values = ['#FF0000','#008000', '#0000FF'] color_dictionary = dict(zip(keys, values)) print(color_dictionary) 阅读全文
posted @ 2018-11-19 10:27 anobscureretreat 阅读(700) 评论(0) 推荐(0)
摘要: d = {'x': 10, 'y': 20, 'z': 30} for dict_key, dict_value in d.items(): print(dict_key,'->',dict_value) 阅读全文
posted @ 2018-11-19 10:25 anobscureretreat 阅读(8282) 评论(0) 推荐(0)
摘要: my_dict = {'x':500, 'y':5874, 'z': 560} key_max = max(my_dict.keys(), key=(lambda k: my_dict[k])) key_min = min(my_dict.keys(), key=(lambda k: my_dict[k])) print('Maximum Value: ',my_di... 阅读全文
posted @ 2018-11-19 10:23 anobscureretreat 阅读(2588) 评论(0) 推荐(0)
摘要: dic1={1:10, 2:20} dic2={3:30, 4:40} dic3={5:50,6:60} dic4 = {} for d in (dic1, dic2, dic3): dic4.update(d) print(dic4) 阅读全文
posted @ 2018-11-19 10:16 anobscureretreat 阅读(191) 评论(0) 推荐(0)
摘要: d = {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60} def is_key_present(x): if x in d: print('Key is present in the dictionary') else: print('Key is not present in the dictionar... 阅读全文
posted @ 2018-11-19 10:15 anobscureretreat 阅读(1958) 评论(0) 推荐(0)
摘要: my_dict = {} if not bool(my_dict): print("Dictionary is empty") 阅读全文
posted @ 2018-11-19 10:12 anobscureretreat 阅读(25560) 评论(0) 推荐(1)
摘要: d = {0:10, 1:20} print(d) d.update({2:30}) print(d) 阅读全文
posted @ 2018-11-19 10:11 anobscureretreat 阅读(848) 评论(0) 推荐(0)