Write a function named "read_json" that takes a JSON formatted string as a parameter and return the data represented by the input in the appropriate types for this language. For example, if the input string represents a JSON object you should return a key-value store containing the same data?

Answers

Answer 1
Answer:

Answer:

Following are the program in the Python Programming Language.

import json #import package

#define function

def read_json(info):

 return json.loads(info)#load data in variable

#call and print the function

print(read_json('[{'A': 10}, {'Y': 16}, {'U': 28}]'))

Output:

[{'A': 10}, {'Y': 16}, {'U': 28}]

Explanation:

following are the description of the code

  • Define function "read_json()" and pass an argument "info" inside it.
  • Return the data inside from the "load()" function .
  • Call the function i.e "read_json" and passing the value to that function.
  • Print function print the data which is inside the "read_json" function.

Related Questions

The ____ area on the status bar includes six commands as well as the result of the associated calculation on the right side of the menu.
Express the worst case run time of these pseudo-code functions as summations. You do not need to simplify the summations. a) function(A[1...n] a linked-list of n integers) for int i from 1 to n find and remove the minimum integer in A endfor endfunction
The program that you create for this exercise will begin by reading the cost of a meal ordered at a restaurant from the user. Then your program will compute the tax and tip for the meal. Use your local tax rate when computing the amount of tax owing. Compute the tip as 18 percent of the meal amount (without the tax). The output from your program should include the tax amount, the tip amount, and the grand total for the meal including both the tax and the tip. Format the output so that all of the values are displayed using two decimal places.
If two light bulbs are wired in series and one bulb burns out the other bulb will
Arrange the following units of storage in descendingorder. B, TB,KB, GB,MB

___________ are used when an SQL statement has to be executed multiple times in a Python script.a

Prepared statements

b

Cursors

c

Connections

d

Queries

Answers

Answer: (A) Prepared statement

Explanation:

 Prepared statement is basically used in the structured query language (SQL) statement which are basically execute multiple times in the python script.

The prepared statement is typically used in the SQL statement for update and queries. It is used to executed for the similar SQL statement and it has high efficiency.

It basically is in the form of template where the database compile and perform various query optimization.

A vowel word is a word that contains every vowel. Some examples of vowel words are sequoia, facetious, and dialogue. Determine if a word input by the user is a vowel word.

Answers

Answer:

vowels = ("a", "e", "i", "o", "u")

word = input("Enter a word: ")

is_all = True

for c in vowels:

   if c not in word:

       is_all = False

if is_all == True:

   print(word + " is a vowel word.")

else:

   print(word + " is not a vowel word.")

Explanation:

Initialize a tuple, vowels, containing every vowel

Ask the user to enter a word

Initially, set the is_all as True. This will be used to check, if every vowel is in word or not.

Create a for loop that iterates through the vowels. Inside the loop, check if each vowel is in the word or not. If one of the vowel is not in the vowels, set the is_all as False.

When the loop is done, check the is_all. If it is True, the word is a vowel word. Otherwise, it is not a vowel word.

. In Stack we can access elements from both ends

o True

o False

Answers

Answer:

False

Explanation:

The answer is False. In Stacks, we can access only the top element present in the stack. Stack is the collection of elements which follow LIFO ( Last In First Out ) which means the last element inserted in the stack is the first element to  out. Stack has restriction that only the element which is present at the top called as top element is only accessible. That means only the top element can be inserted and deleted.

In real-world environments, once the domains that are affected by the risks are identified, subsequent next steps would include:______.

Answers

Answer:

Explanation:

In real-world environments, once the domains that are affected by the risks are identified, subsequent next steps would include selecting, implementing, and testing controls to minimize or eliminate those risks.

Two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends decide to split the bill evenly between them, after adding 15% tip for the service. Calculate the tip, the total amount to pay, and each friend's share, then output a message saying "Each person needs to pay: " followed by the resulting number.

Answers

Answer:

bill = 47.28

tip = bill * 0.15

total_pay = bill + tip

each_share = total_pay / 2

print("Each person needs to pay: " + str(each_share))

Explanation:

*The code is in Python.

Set the bill

Calculate the tip, multiply the bill by 0.15

Calculate the total_pay, add bill and tip

Calculate each friend's share, divide the total_pay by 2. Then, print it in required format.

Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its digits are even (0, 2, 4, 6, 8). For example, the call allDigitsOdd(135319) returns true but allDigitsOdd(9145293) returns false.

Answers

Answer:

Sample output:

Enter integer 3232423

true

Enter integer 12131231

false

Explanation:

Above is the output of the program and for the solution check the screenshots attach to understand clearly the program.

Thanks