diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-24 15:15:47 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-24 15:15:47 -0800 |
commit | fcd4ae827171717ea501bf833a6b6abd70edc5a3 (patch) | |
tree | 87dab361b687f70f2c47139c53ddf820c471cbb8 /tests/basics/bytes.py | |
parent | 58b8a6202ac5f5c66bc136e7cfc553db4bf88845 (diff) | |
parent | 91fb1c9b13021e90fa2f8c2105c135fc14ac71db (diff) | |
download | micropython-fcd4ae827171717ea501bf833a6b6abd70edc5a3.tar.gz micropython-fcd4ae827171717ea501bf833a6b6abd70edc5a3.zip |
Merge pull request #221 from pfalcon/basic-bytes
Add basic implementation of bytes type, piggybacking on str.
Diffstat (limited to 'tests/basics/bytes.py')
-rw-r--r-- | tests/basics/bytes.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/bytes.py b/tests/basics/bytes.py new file mode 100644 index 0000000000..7d0cf22d44 --- /dev/null +++ b/tests/basics/bytes.py @@ -0,0 +1,11 @@ +a = b"123" +print(a) +print(str(a)) +print(repr(a)) +print(a[0], a[2]) +print(a[-1]) + +s = 0 +for i in a: + s += i +print(s) |