Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Other data types

Vyper has other data types that have not been used in the donation smart contract, as shown in the following list:

  • bool: This data type is like a normal Boolean. It holds true or false values, as shown in the following code:
bull_or_bear: bool = True
  • decimal: This data type is like float or double in Python, as shown in the following code:
half_of_my_heart: decimal = 0.5
  • bytes32: This data type is like bytes32, with a peculiarity. If the length of the value is less than 32 bytes, it will be padded with zero bytes. So, if you set the messi value (5 characters/bytes) to the bytes32 data type variable (as shown in the following code), it will become messi\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content