Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson12-3

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson12-3
  • l1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · f93c5605
    BellCodeEditor committed 2 years ago
    f93c5605
l1.py 289 Bytes
1 2 3 4 5 6 7 8 9 10 11 12
file1 = open(r"C:\Users\ming\Desktop\test.txt",'r',encoding='utf-8')
for data in file1:
    if data == "小强:10本\n":
        print("找到了")
file1.close()

a = "0123456789"
index_in = int(input("请输入下标:"))
try:
    print(a[index_in])
except:
    print(a[-1])