कभी सपनों मे अपनों के सपनों को जरा सहेजना तो!
हो सकता है़!
कभी महसूस न किया तुमने होगा जो समझ आए वो!
यूँ बन वाचाल खुदा को बेवजह न तकलीफ़़ में डाल!
दे सकता है!
ये पुरे जमाने का दर्द; ज़रा समझ; न बन अतफ़ाल!
कभी सपनों मे अपनों के सपनों को जरा सहेजना तो!
हो सकता है़!
कभी महसूस न किया तुमने होगा जो समझ आए वो!
यूँ बन वाचाल खुदा को बेवजह न तकलीफ़़ में डाल!
दे सकता है!
ये पुरे जमाने का दर्द; ज़रा समझ; न बन अतफ़ाल!
https://stackoverflow.com/a/59004613/6615163
In [1]: import re
In [2]: listA = ['123', '345', '678']
In [3]: listB = ['ABC123', 'CDE455', 'GHK678', 'CGH345']
def get_pattern(n=3, separator=' '):
a = 0
pattern = ''
for i in range(0, n):
for j in range(0, n):
Just to understand where exactly you have to do the modification and what little mistake you did has already been pointed out in the above comments.
> var arr = [ "{\"id\": \"amzn\", \"price\": 1785.6600341796875, \"_attachments\": \"attachments/\"}", "{\"id\": \"msft\", \"price\": 138.42999267578125, \"_attachments\": \"attachments/\"}", "{\"id\": \"googl\", \"price\": 1244.280029296875, \"_attachments\": \"attachments/\"}", "{\"id\": \"ba\", \"price\": 331.05999755859375, \"_attachments\": \"attachments/\"}", "{\"id\": \"air.pa\", \"price\": 122, \"_attachments\": \"attachments/\"}" ]
undefined
>
> item0 = arr[0]
'{"id": "amzn", "price": 1785.6600341796875, "_attachments": "attachments/"}'
>
> item0Obj = JSON.parse(item0)
{ id: 'amzn', price: 1785.6600341796875, _attachments: 'attachments/' }
Check my answer at https://stackoverflow.com/a/58067032/6615163
>>> class TEST:
... def __init__(self, project = 'ABC', scenarios = {'A': [1,2,3], 'B': [4,5,6]}):
... self.project = project
... for feature in scenarios:
>>> import requests
>>>
>>> res = requests.get("https://www.amazon.in/b/ref=s9_acsd_hfnv_hd_bw_b3iMERj_ct_x_ct00_w?_encoding=UTF8&node=10485223031&pf_rd_m=A1VBAL9TL5WCBF&pf_rd_s=merchandised-search-3&pf_rd_r=59M3EPGWMDMASM4XWYPJ&pf_rd_r=59M3EPGWMDMASM4XWYPJ&pf_rd_t=101&pf_rd_p=e2e13b35-daa5-587b-aab3-6e9e9135fd3c&pf_rd_p=e2e13b35-daa5-587b-aab3-6e9e9135fd3c&pf_rd_i=3403856031")
>>>
>>> res.status_code
200
>>>
>>> res.text
In Python, list, dictionary are reference types. So if you will append the same dictionary to a list and if you will make any change to any of the dictionary, it will reflect in all other as well because all are pointing to the same memory location.
>>> l = [{"name": "Raghavendra Thakur", "age": 27}] * 4
>>>
>>> l
[{'name': 'Raghavendra Thakur', 'age': 27}, {'name': 'Raghavendra Thakur', 'age': 27}, {'name': 'Raghavendra Thakur', 'age': 27}, {'name': 'Raghavendra Thakur', 'age': 27}]
>>>
>>> l[0]