摘要:
count = 0total = 0user_input = input("请输入数字(完成所有数字输入后,请输入q终止程序):")while user_input != "q": num = float(user_input) total += num count += 1 if count == 阅读全文
posted @ 2025-10-30 21:59
偷懒的阿贤
阅读(7)
评论(0)
推荐(0)
摘要:
total = 0#range(1,101) 其实是加到100,不会加到101for i in range (1,101): total = total + iprint("\n" + str(total)) 阅读全文
posted @ 2025-10-30 21:48
偷懒的阿贤
阅读(4)
评论(0)
推荐(0)
摘要:
#声明字典slang_dict = {}slang_dict["觉醒年代"] = "A"slang_dict["双剑"] = "何必"slang_dict["加入"] = "“打不过”"query = input("请输入您想要查询的文字:")if query in slang_dict: prin 阅读全文
posted @ 2025-10-30 20:09
偷懒的阿贤
阅读(11)
评论(0)
推荐(0)
摘要:
shopping_list = []shopping_list.append("键盘")shopping_list.append("键帽")print(shopping_list)print(shopping_list[0])print(len(shopping_list))price = [1,2 阅读全文
posted @ 2025-10-30 18:01
偷懒的阿贤
阅读(16)
评论(0)
推荐(0)
摘要:
house_work_count = int(input("house_work_count:"))red_envelope_count = int(input("red_envelope_count:"))shopping_count = int(input("shopping_count:")) 阅读全文
posted @ 2025-10-30 17:48
偷懒的阿贤
阅读(6)
评论(0)
推荐(0)
摘要:
#BMI = 体重 / (身高 ** 2)user_weight = float(input("请输入您的体重(单位:kg):"))user_height = float(input("请输入您的身高(单位:m):"))user_BMI = user_weight / (user_height) * 阅读全文
posted @ 2025-10-30 17:37
偷懒的阿贤
阅读(7)
评论(0)
推荐(0)
摘要:
mood_index = int(input("对象今天的心情指数是:"))if mood_index >= 60: print("恭喜,今晚应该可以打游戏,去吧皮卡丘!") print("<><><><><>")else: # mood_index<60 print("为了自个儿小命,还是别打了。 阅读全文
posted @ 2025-10-30 17:24
偷懒的阿贤
阅读(8)
评论(0)
推荐(0)
摘要:
#BMI = 体重 / (身高 ** 2)user_weight = float(input("请输入您的体重(单位:kg):"))user_height = float(input("请输入您的身高(单位:m):"))user_BMI = user_weight / (user_height) * 阅读全文
posted @ 2025-10-30 17:12
偷懒的阿贤
阅读(5)
评论(0)
推荐(0)
摘要:
python脚本是对代码进行一行一行的解释并执行,所以可以不读完整个文件,进行执行某一行命令 交互模式:打开cmd中的命令行或者编辑器中的python命令行 阅读全文
posted @ 2025-10-30 16:51
偷懒的阿贤
阅读(6)
评论(0)
推荐(0)
摘要:
s = "一切问题都可以解决"#打印s变量print(s)#打印s变量类型print(type(s))#打印s变量中最后一个字符print(s[len(s)-1])#None类型,标识什么类型都不是none = None#打印none变量类型print(type(none))#布尔类型 只有Fals 阅读全文
posted @ 2025-10-30 16:45
偷懒的阿贤
阅读(5)
评论(0)
推荐(0)
摘要:
单行注释: # a 多行注释: ''' aaa bbb ''' 阅读全文
posted @ 2025-10-30 16:33
偷懒的阿贤
阅读(7)
评论(0)
推荐(0)
摘要:
import math python的math库并不提供简单的加减乘除的api,如:add import math # 求和s = math.fsum([0.1, 0.2, 0.3]) # 0.6,减少浮点累积误差 # 连乘p = math.prod([1, 2, 3, 4]) # 24 # 余数与 阅读全文
posted @ 2025-10-30 16:28
偷懒的阿贤
阅读(6)
评论(0)
推荐(0)
摘要:
变量名字只能由文字、数字、下划线组成 下划线命名法:字母全部小写;不同单词用下划线分开;解释器区分大小写 阅读全文
posted @ 2025-10-30 16:03
偷懒的阿贤
阅读(6)
评论(0)
推荐(0)
摘要:
greet = "你好"greet_chinese = greetgreet_english = "you hello"greet = greet_englishprint("\n" + greet + "13233455566")print(greet_chinese + "16522598746 阅读全文
posted @ 2025-10-30 15:57
偷懒的阿贤
阅读(3)
评论(0)
推荐(0)
摘要:
print(''' aaa bbb ccc ''') '''引起来的括号区域,解释器可以认作是多行在print 阅读全文
posted @ 2025-10-30 15:03
偷懒的阿贤
阅读(8)
评论(0)
推荐(0)
摘要:
print("爸爸") 阅读全文
posted @ 2025-10-30 15:02
偷懒的阿贤
阅读(6)
评论(0)
推荐(0)
摘要:
python下载Download Python | Python.org pycharm下载Download PyCharm: The Python IDE for data science and web development by JetBrains 阅读全文
posted @ 2025-10-30 15:01
偷懒的阿贤
阅读(14)
评论(0)
推荐(0)
摘要:
监督学习的定义与核心要素监督学习(Supervised Learning)是机器学习的一种范式,使用带有标签的样本数据训练模型,使其能够从输入特征 X预测输出标签 y,并对未见过的样本进行泛化。训练数据由若干样本对组成,每个样本包含一个输入对象(通常为特征向量 阅读全文
posted @ 2025-10-30 10:42
偷懒的阿贤
阅读(45)
评论(0)
推荐(0)
浙公网安备 33010602011771号