- 博客(5)
- 收藏
- 关注
原创 初识函数(05)
1. Write a Python function to ask users to enter their password twice (Can be numbers, letters or special characters) , and return a boolean value to determine whether the two passwords are the same. 编写一个函数,該函數需要用戶輸入兩次密碼 (可以是任意位數的數字,字母或特殊字符),并返回判斷兩次密碼是否相同的
2021-09-27 15:59:58 216
原创 字典运用(04)
1. Create a dictionary to store information for 10 students as follows. 2. Allow users to search for student info based on student ID. 允許用戶使用student ID查詢学生记录。 3. Output all student info based on sorted student ID. 请根据学生学号从小到大输出所有学生的信息。 import pprint .
2021-09-21 10:31:38 252
原创 字串符英文标点转空格(03)
Given a hotel review as "The location is great. Took advantage of the downtown location to walk to dinner, check out a couple galleries, and have drinks. It was great. I highly recommend this hotel for anyone visiting downtown. However, the condition of t
2021-09-21 10:27:03 552
原创 List 切片练习(02)
Solve your problems in Jupyter Notebook and submit the Jupyter notebook(.ipynb) file: D1-zhangsan-ass2.ipynb. 1. 利用下面的phrase,使用切片的方法,生成一個new_phase,'Use it!'. phrase="Let's just do it!" phrase="Let's just do it!" a=list(phrase) Use_it=''.join(a[7:9])+
2021-09-21 10:20:52 307
原创 判断是否为回文字串符号(01)
defreverse(text): returntext[::-1] defisHuiWen(text): returntext.lower()==reverse(text).lower() text=input("输入一个字符串判断是否是回文字符串:\n") ifisHuiWen(text): print("该字符串是回文") else: print("该字符串不是回文") 上文为方法一,在考虑文本大小写后改变的代码。下文为...
2021-09-19 15:43:47 176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人