skip to Main Content

Json – i have two files ,a text file with a name in it and a j son file with a dataset of names.I'm trying to verify if there is a name inside the text fiie

import json with open('/home/sentry/Documents/mark.txt', 'r') as f1,open('/home/sentry/Downloads/axtscz-english-first-names/Male.json', 'r') as f2: content = f1.read() data = json.load(f2) for p_id in data: name = p_id.get('name') if name in content: # This is where my problem is. print('True') else: print(content) print (name) The…

VIEW QUESTION

Getting a list from a file? – Photoshop

In a hangman game I am making, I have a text file containing this: [ [ ['microsoft windows','common operating system',1], ['apple ios,a useless operating system',1], ['chromeos','a very simple OS developed by chrome',1], ["linux","the most accesable and custimizable OS",1] ], […

VIEW QUESTION
Back To Top
Search