摘要: 题目要求: Notepad style application that can open, edit, and save text documents. Add syntax highlighting and other features. 下面的代码实现了部分第一行题目要求 没有实现第二行题目要 阅读全文
posted @ 2020-03-28 17:37 YlnChen 阅读(419) 评论(0) 推荐(0)
摘要: 题目要求: read these strings in from a text file and generate a summary. import os def count_words(file): try: f = open(file, 'r', encoding='UTF-8') excep 阅读全文
posted @ 2020-03-28 12:02 YlnChen 阅读(177) 评论(0) 推荐(0)
摘要: class practiceYln(): def __init__(self): self.text1 = None self.text2 = None def cwistr(self): text1 = input("please input a string:") text2 = input(" 阅读全文
posted @ 2020-03-27 15:02 YlnChen 阅读(140) 评论(0) 推荐(0)
摘要: class practiceYln(): def __init__(self): # 类参数的初始化 self.text = None def checkifpalindrome(self): self.text = input('please input a word:') # input用来接收 阅读全文
posted @ 2020-03-27 11:48 YlnChen 阅读(124) 评论(0) 推荐(0)
摘要: class PracticeYln(): def __init__(self, text): self.text = text # 不能写 = None, 注释必须举例语句一个空格以上,并且井号后面也有空格! def countvowels(self, text): aa = list(self.t 阅读全文
posted @ 2020-03-27 11:20 YlnChen 阅读(188) 评论(0) 推荐(0)
摘要: class practiceYln(): def __init__(self): self.text = None def piglatin(self, text): if text[0] in ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']: 阅读全文
posted @ 2020-03-27 11:18 YlnChen 阅读(99) 评论(0) 推荐(0)
摘要: 1 class practiceYln(): #创建一个名叫practiceYln的类 2 def __init__(self, string): #有参构造函数 3 self.string = string 4 def reversedtext(self, string): 5 str(self. 阅读全文
posted @ 2020-03-27 11:06 YlnChen 阅读(73) 评论(0) 推荐(0)