I found a great document about dicts,tuples and list, you can easliy understand three of them and learn differences between dicts,tuples and lists . Also in this document, you can find how to add a record for each of them. what is the difference between tuple and list in python? tuples are immutable, you can … Read more
C++ ile yazdığım telefon defterinin benzerini python ile yazdım. Dict kullandığımdan dolayı aynı isimde iki kişi olmamasına dikkat edin, dilerseniz list yapısına çevirebilirsiniz. Aynı klasörde example.txt’yi yaratmayı unutmayın ( windows için tam path girmeniz lazım.) Surname kısmını eklemek isterseniz, pdict[name] =(phone,surname) şeklinde ekleyebilirsiniz. This python phone book is about same with c++ one. I used … Read more
# change a hexadecimal string to decimal number and reverse # check two different representations of the hexadecimal string # negative values and zero are accepted # tested with Python24 vegaseat 11oct2005 def dec2hex(n): “””return the hexadecimal string representation of integer n””” return “%X” % n def hex2dec(s): “””return the integer value of a hexadecimal … Read more
