diff options
author | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-21 14:47:55 +0200 |
---|---|---|
committer | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-21 14:47:55 +0200 |
commit | 9be024dc35977168f907b2fc50b327cfc7ad850b (patch) | |
tree | 6c9ee8a12f5185769cb29e6168d1cc7b3c71e3b1 /docs/examples/tutorial/string | |
parent | 047809103580445f4dae65bb8c646dcd52231a10 (diff) | |
download | cython-9be024dc35977168f907b2fc50b327cfc7ad850b.tar.gz |
Moved an example of for loop with char* to the examples directory.
Diffstat (limited to 'docs/examples/tutorial/string')
-rw-r--r-- | docs/examples/tutorial/string/for_char.pyx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/examples/tutorial/string/for_char.pyx b/docs/examples/tutorial/string/for_char.pyx new file mode 100644 index 000000000..1de615ad1 --- /dev/null +++ b/docs/examples/tutorial/string/for_char.pyx @@ -0,0 +1,6 @@ +cdef char* c_string = "Hello world"
+
+cdef char c
+for c in c_string[:11]:
+ if c == 'A':
+ print("Found the letter A")
|