how to parse the response in python?
import json import requests response = requests.get(…) json_data = json.loads(response.text)
import json import requests response = requests.get(…) json_data = json.loads(response.text)
A variable which is defined inside a function is local to that function. It is accessible from the point at which it is defined until the end of the function and exists for as long as the function is executing. you can pass the values as arguments to other functions def naming(in_name): # function to … Read more
Couple of points: Misplaced return statement. Should be at end. if yes(): It is wrong. You want to compare function input with yes. It should be if s == ‘yes’:. Same for rest also. Since you have written function definition as def shut_down(s):, it is expecting one argument. You should pass one argument while calling … Read more