摘要: python 字符串的内置常用方法(后面会继续更新) ​ find方法(查找) # 查找子字符串 s = "hello world" print(s.find("world")) # 输出:6 print(s.find("earth")) # 输出:-1 # 指定查找范围 s = "hello wo 阅读全文
posted @ 2023-12-08 21:15 java转php 阅读(48) 评论(0) 推荐(0)
摘要: python 的循环 for循环 # 遍历列表 my_list = [1, 2, 3, 4, 5] for i in my_list: print(i) # 遍历字符串 my_string = "Hello, World!" for letter in my_string: print(letter 阅读全文
posted @ 2023-12-08 20:38 java转php 阅读(26) 评论(0) 推荐(0)