Advertisement
Guest User

help plz

a guest
Mar 30th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #! /usr/bin/env python3.5
  2. import pymongo
  3. from datetime import datetime
  4.  
  5.  
  6. client = pymongo.MongoClient()
  7. db = client.db_words
  8. collection = db.collection_words
  9.  
  10.  
  11. if start[0] == 'learn':
  12.     show_word = collection.find().limit(5)
  13.     for i in show_word:
  14.         try:
  15.             while True:
  16.                 print(i["eng"])
  17.                 answer = input()
  18.                 if answer == i["ru"]:
  19.                     i["count"] = int(i["count"]) + 1 #как сохранить изменения в i["count"] ?
  20.                     collection.save(i["count"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement