Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3.5
- import pymongo
- from datetime import datetime
- client = pymongo.MongoClient()
- db = client.db_words
- collection = db.collection_words
- if start[0] == 'learn':
- show_word = collection.find().limit(5)
- for i in show_word:
- try:
- while True:
- print(i["eng"])
- answer = input()
- if answer == i["ru"]:
- i["count"] = int(i["count"]) + 1 #как сохранить изменения в i["count"] ?
- collection.save(i["count"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement