摘要: count=1while count<=100: if count%2==1: print(count) count = count + 1运行结果显示: 阅读全文
posted @ 2023-11-05 11:45 Thomas2023 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 方法一:sum=0for i in range(1,101,1): sum=sum+iprint(sum)运行以上代码,显示结果: 方法二: sum=0count=1while count<=100: sum=sum+count count=count+1 print(count)print(sum 阅读全文
posted @ 2023-11-05 10:08 Thomas2023 阅读(51) 评论(0) 推荐(0) 编辑
摘要: while中使用break和continue: count=0##计数器while True: s=input('请输入内容:') if s=='退出': print(count) print('退出!') break##退出循环 if '生气' in s: print(count) continu 阅读全文
posted @ 2023-11-05 09:59 Thomas2023 阅读(14) 评论(0) 推荐(0) 编辑
摘要: count=1while count<=8: print('干活!')#循环输出8次就停止 count+=1运行结果: 阅读全文
posted @ 2023-11-05 08:10 Thomas2023 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 以下为思路提供,因为涉及我的知识版权,所以不能完全公开具体的操作方法,只能提供大概思路,仅供参考,不构成任何买卖依据。 一、先从某APP 下载数据,以文本文件格式保存到本地盘。(至于如何下载,这个暂时不公开方法。) 二、1.txt文件内容的格式,对应某一个热门板块,以方便后面用kettle ETL工 阅读全文
posted @ 2023-11-05 01:23 Thomas2023 阅读(14) 评论(0) 推荐(0) 编辑
摘要: import tushare as tsimport pandas as pdfrom sqlalchemy import create_enginefrom psycopg2 import sqlimport datetimeimport cx_Oracle class Oracle(object 阅读全文
posted @ 2023-11-05 00:26 Thomas2023 阅读(90) 评论(0) 推荐(0) 编辑
摘要: import cx_Oracleclass Oracle(object): def __init__(self, user_name, password, host, instance): self._conn = cx_Oracle.connect('%s/%s@%s/%s' % (user_na 阅读全文
posted @ 2023-11-05 00:00 Thomas2023 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 代码如下: a=input('请输入分数:')score=int(a)if score>=90: print('A')elif score>=80: print('B')elif score>=70: print('C')elif score>=60: print('D')else: print(' 阅读全文
posted @ 2023-11-04 23:27 Thomas2023 阅读(26) 评论(0) 推荐(0) 编辑