自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 2021-06-24

**大数据原理问题总结**1.多次对namenode进行格式化导致节点无法启动的解决多次格式化namenode造成了namenode和datanode的clusterID不一致。每次格式化时,namenode会更新clusterID,但是datanode只会在首次格式化时确定,因此就造成不一致现象。2.在linux中,当你在命令行输入:hadoop结果:hadoop:未找到命令问题原因:没有将hadoop命令添加至执行路径3.拒接连接问题在/user/local/hadoop 下输入 ..

2021-06-24 23:26:57 177 2

原创 Untitled25

import tkinterimport tkinter.messageboxroot = tkinter.Tk()root.title('猜数字')root.geometry('300x300')shuzi=tkinter.StringVar()Label = tkinter.Label(root,text="请输入1到100以内的整数")Label.place(x=10,y=10,width=180,height=40)sg = tkinter.StringVar(root)E

2020-12-23 23:47:06 156

原创 BMI问题

class BMI: def __init__(self,name,age,weight,height): self.name = name self.age = age self.weight = weight self.height = height self.bmi = self.weight / (self.height*self.height) def get_name(s

2020-12-10 10:50:13 214

原创 BMI标准判断问题

class BMI:# 定义一个BMI类 def __init__(self,name,age,weight,tall): # 初始化函数 self.name = name self.age = int(age) self.weight = int(weight) self.tall = float(tall) def say(self): print("{n},的BMI是,{p}".forma

2020-12-09 22:39:00 413

原创 本地代码上传云端仓库(git)

新建代码仓库(云端github,gitee,etc)创建一个仓库仓库的url:https://github.com/LCY0914/work.git本地代码上传到新建的云端仓库本地的代码仓库(本地文件夹)启动Git bash命令linux操作命令:pwd # 显示当前所在的路径cd 路径 # change directory,进入指定的路径下进入了本地的代码仓库(文件夹)ls -a # ls:list,-a:all,显示当前路径下所有的文件及文件夹初始化当前文件夹为一个G

2020-12-03 12:05:01 631

原创 约瑟夫问题2

def qiuhe(x,y): """ 用于求和的函数。 Input: x:接收一个实数; y:接收一个实数。 Output: 返回x+y的计算结果 """ z=x+y return zresult = qiuhe(1,2) #函数的调用print(result)3list1=[i for i in range (1,40)]print(list1)while len(list1)>

2020-11-26 18:13:12 264

原创 猜数字游戏

import randomn=int(random.random()*50+1)i=1while i<=5: cin= int(input("请输入你要猜的数字:")) if(cin<n): print("你输入的数字较小") i = i+1 elif(cin>n): print("你输入的数字较大") i = i+1 elif n == cin: print("恭喜你猜对

2020-11-19 11:48:54 173

原创 词频统计

# 打开并读取文件file = open(r'C:\Users\Administrator\Desktop\Walden.txt','r')lines = file.readlines()# 要把每行拆成单词words = []for line in lines: tmp_list = line.split() for word in tmp_list: words.append(word.replace(',','').replace('.','').repl

2020-11-19 11:42:21 379

原创 随机点名

keys = [1,2,3,4]valubs = ['张三',‘李四’,‘王五’,‘赵六’]# 创建字典students = {}i=0 File "<ipython-input-22-5fcc9c342a9d>", line 2 valubs = ['张三',‘李四’,‘王五’,‘赵六’] ^SyntaxError: invalid character in identifier# 创建一个字典stud

2020-11-19 10:28:57 251

原创 walden

f=open("e:\Users\lenovo\Desktop","r").read() File "<ipython-input-2-900b47d8738b>", line 1 f=open("e:\Users\lenovo\Desktop","r").read() ^SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncate

2020-11-18 22:45:11 94

原创 字典。元祖。集合增删改查

字典的增删改查dict1=['a','b','c',4,5,6]dict1.insert(1,'a')dict1['a', 'a', 'b', 'c', 4, 5, 6]del dict1[-1]dict1['a', 'a', 'b', 'c', 4, 5]dict1[0:2]['a', 'a']list1.pop(1)list1['a', 'c', 4, 5, 6]元组t1 = ([1,2,3],4) print(t1)([1, 2, 3], 4)

2020-11-11 22:41:09 134

原创 break和continue

break和continue相同点:两个语句都是跳出循环不同点:break语句的作用是直接终止整个循环,其后面内容都不执行,并会返回设置的跳出后的值。而continue语句的作用是只跳出本次循环并开始下一轮循环。for i in range(1,10): if i % 2 == 0: breakprint(i)2a={1}a.remove(1)for i in range(1,10): if i % 2 == 0:

2020-11-10 20:15:58 103

原创 约瑟夫

数字游戏list1=[i for i in range (1,40)]print(list1)[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]while len(list1)>2: list2=list1[0:2] list1.ap

2020-11-10 18:39:05 69

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除