This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "postId": 1, | |
| "id": 1, | |
| "name": "id labore ex et quam laborum", | |
| "email": "Eliseo@gardner.biz", | |
| "body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium" | |
| }, | |
| { | |
| "postId": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <root> | |
| <element> | |
| <body>laudantium enim quasi est quidem magnam voluptate ipsam eos | |
| tempora quo necessitatibus | |
| dolor quam autem quasi | |
| reiciendis et nam sapiente accusantium</body> | |
| <email>Eliseo@gardner.biz</email> | |
| <id>1</id> | |
| <name>id labore ex et quam laborum</name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Vlan100 | |
| description Data VLAN for Access-Switch | |
| ip address 10.1.1.1 255.255.255.0 | |
| ip helper-address 10.1.2.1 | |
| standby 1 ip 10.1.1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Vlan100 | |
| description Data VLAN for Access-Switch | |
| ip address 10.1.1.1 255.255.255.0 | |
| ip helper-address 10.1.2.1 | |
| glbp 1 ip 10.1.1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <persons> | |
| <element> | |
| <gender>male</gender> | |
| <name>Jeff Bezos</name> | |
| </element> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xml.etree.ElementTree as ET | |
| tree = ET.parse('persons.xml') | |
| root = tree.getroot() | |
| # total number of nodes from root | |
| print('\nNumber of Nodes:') | |
| print(len(root[0])) | |
| # all nodes data | |
| print('\nNode Data:') | |
| for elem in root: | |
| for subelem in elem: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xml.dom import minidom | |
| doc = minidom.parse("persons.xml") | |
| elements = doc.getElementsByTagName("element") | |
| for element in elements: | |
| name = element.getElementsByTagName("name")[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "gender": "male", | |
| "name": "Jeff Bezos" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| with open('persons.json', 'r') as f: | |
| my_dict = json.load(f) | |
| for distro in my_dict: | |
| print(distro['gender']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - gender: male | |
| name: Jeff Bezos | |
| - gender: male | |
| name: Elon Musk |