기본적으로 파일에 쓰는 방법에 대한 도움이 필요합니다. 그런 다음 파일에있는 특정 부분을 출력하십시오.파일에 쓰기 [Python]
name = input("Please enter your name: ")
print ("This is level 1"
mylist=["Man utd are the best team","I am going to be a pro typer.","Coding is really fun when you can do it."]
x=random.choice (mylist)
print ("The sentence I would like you to type is: ")
print (x)
wait = input ("Please press enter to continue, The timer will start upon hitting enter!")
start = time.time()
sentence = input("Start typing: ")
end = time.time()
overall = end - start
if sentence == (x):
print ("It took you this many seconds to complete the sentence: %s" % overall)
이름에 높은 점수를 기록하고 싶습니다. 그래서 저는 누군가가 문장을 완성하는 데 걸리는 시간을 파일에 쓰고 싶습니다. 그런 다음 파일에서 최적의 시간을 출력하십시오. 프로그램을 다시 실행하면 걸리는 시간이 파일에 저장됩니다. 어떤 시간이 가장 좋은지 출력됩니다. 이것이 가능한가? 도와주세요. 나는 코딩에 익숙하지 않다.
: 파일에서 시간을 검색 할 때 나중에
, 같은 것을 사용 . – MackM