Skip to content

raghadabbas123/VC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#https: // github.com / DataGlacier / VC.git import json, os os.chdir(os.path.dirname(os.path.abspath(file)))

User can add name and favourite sport in response.json

default sport Cricket will be added incase user does not provide fav sport

def load_json(): with open('../response.json') as json_obj: response = json.load(json_obj) return response

response = load_json()

def write_json(data,filename = '../response.json'): with open(filename,'w') as file: json.dump(data,file,indent=0)

def call_sport(): name = input("Please add your name: ") sport = input("Please add your favourite sports name: ") if (sport == ""): sport = 'Cricket' if (name): response[name] = sport write_json(response)

if name == "main": call_sport()

call_sport()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%