Using JavaScript and JSON in Django | Week 4
Course Name: Django for Everybody
Sub-course: Using JavaScript and JSON in Django
Course Link: Django for Everybody
Sub-course Link: Django Features and Libraries
These are Using JavaScript and JSON in Django Week 4 Answers Coursera Quiz
JSON
Q1. What is the act of converting a Python dictionary into a string format so it can be translated across a network?
- USB
- ASN.1
- serialization
- pickling
Answer: serialization
Q2. What is the preferred variable type for the first parameter to JsonResponse? This is also the type that does not require “safe=False” to be set on the JsonResponse statement.
- object
- list
- function
- method
- dictionary
Answer: dictionary
These are Using JavaScript and JSON in Django Week 4 Answers Coursera Quiz
Q3. Which of the following is not a primitive type supported in JSON?
- boolean
- array
- string
- url
- integer
Answer: url
Q4. In the following JSON, how would you print the value “six”?
- alert(five)
- alert(five.six)
- alert(data[‘six’])
- alert(data.five[0])
- alert(data.eight.nine)
Answer: alert(data.five[0])
These are Using JavaScript and JSON in Django Week 4 Answers Coursera Quiz
Q5. What does the Django’s JsonResponse do?
- Takes a Python object or list and serializes it into a JSON string representation
- Encodes all non-printing characters with their hexadeciamal equivalents
- Encodes the less-than and greater-than characters to make a string safe for JSON
- Reads a JSON string representation and converts it to a PHP object or list
Answer: Takes a Python object or list and serializes it into a JSON string representation
Q6. What is the JavaScript call to retrieve a JSON document from the server?
- json_encode()
- fetch()
- xHttpRequest()
- getJSON()
Answer: fetch()
These are Using JavaScript and JSON in Django Week 4 Answers Coursera Quiz
More Weeks of this course: Click Here
More Coursera Courses: http://progiez.com/coursera