Float format for print { value:width.precesion f} result =0.28715647 eg. print('result {r:10:3f}').format(r = result) see link its too good https://pyformat.info/ use tab button to auto complete the string Strings are immutable means we can't modify the any index of the string also dictionaries are immutable while in list are mutable we can change index at any where mylist=[1,2,3,4,5] mylist.append(6) result should be [1,2,3,4,5,6] don't assign the variable name to already defined function such as in case of list it is mylist.append(), mylist.pop(), mylist.sort() dictionary formatting dictionary is same as list but the difference is that in dic. at every index there is key value present as like below {'key1': 'string/list/value', 'key2': 'string/list/value'} point is that dictionaries available in curly parenthesis dictionaries doesn't have any retain order and sequences tuples are also immutable eg. (...
Comments
Post a Comment