pythonV1V2/第38讲 全员debug/课堂成果/课后作业-找出感叹号.py
sairate 7df250638d chore: 添加项目基础结构和示例代码
- 创建 .idea 目录和相关配置文件,设置项目结构
- 添加多个课堂成果示例代码,涵盖不同主题和功能
- 创建和配置 .gitignore 文件,忽略特定文件和目录
2025-07-05 09:36:00 +08:00

25 lines
431 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'''【课后作业要求】
请找出下列代码中的3处错误并改正
def check(s):
if "!" in s
print("字符串中含有感叹号!")
else:
print("字符串中没有感叹号!")
string = "Hello world"
check(s) '''
def check(s):
if "!" in s:
print("字符串中含有感叹号!")
else:
print("字符串中没有感叹号!")
string = "Hello world"
check(string)