lhf 7 сар өмнө
commit
afa2a2f068

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml

+ 19 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,19 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <option name="ignoredErrors">
+        <list>
+          <option value="N802" />
+        </list>
+      </option>
+    </inspection_tool>
+    <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoredIdentifiers">
+        <list>
+          <option value="PyQt5.QtCore.Qt.*" />
+        </list>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Black">
+    <option name="sdkName" value="Python 3.12 (base)" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="tf" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/xm.iml" filepath="$PROJECT_DIR$/.idea/xm.iml" />
+    </modules>
+  </component>
+</project>

+ 8 - 0
.idea/xm.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="tf" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 21 - 0
1.py

@@ -0,0 +1,21 @@
+# 定义变量 姓名 年龄 身高
+name ='小明' #可以使用 input 输入
+age=18 #可以使用 input 输入
+height = 1.71 #可以使用 input 输入
+# 要求按照以下个数输出个人信息
+#我的名字是 xx,年龄是 xx,身高是 xx m
+# 使用格式化输出实现
+#print('我的名字是 name,年龄是 age,身高是 height m')
+print('我的名字是 %s,年龄是 %d,身高是%f m' % (name, age, height))
+# 小数默认显示 6 位,如果想要指定显示小数点后几位, %.nf,n 需要换成具体的整数数字,即保留小数的位置
+print('我的名字是 %s,年龄是 %d,身高是%.2fm' % (name, age, height)) # 两位小数
+print('我的名字是 %s,年龄是 %d,身高是%.1f m' % (name, age, height)) # 一位小数
+
+# 补充
+stu_num = 1 #学号
+#我的学号是 800001
+print('我的学号是%d'% stu_num)
+# %nd n 需要换成具体的整数数字,表示整数一共占几位print('我的学号是%06d’%stu_num)
+num=90 #考试的及格率
+# 某次考试的及格率为 98%,如果在 格式化中需要显示%,在书写的使用需要使用 两个 %% 才可以
+print('某次考试的及格率为 %d%%'% num)

+ 1 - 0
automated-testing-

@@ -0,0 +1 @@
+Subproject commit 8d350fe9eba5a4ae6143b93e72f371fef4629c29

+ 10 - 0
变量.py

@@ -0,0 +1,10 @@
+#变量
+#作用:是用来存储数据的(在程序代码中出现的数据,想要保存下来使用,就必须使用变量),
+# 如:测试数据,用户名,密码,验证码
+#变量注意实现:变量必须先定义(保存数据)后使用(取出数据).
+
+#定义变量
+#变量名 =数据值 (可以理解为 是将数据值保存到变量中)
+
+#使用变量
+#变量定义之后,想要是使用变量中的数据,直接使用变量名即可