Skip to content

Commit

Permalink
added loop docs in reamde.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalebu committed Jan 2, 2021
1 parent 64f66fe commit c41a124
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,30 @@ umri wako ni 12
```python
>>> njia jumla(a, b):
-> njia jumla(a, b):
... rudisha a + b
...
>>> andika(jumla(20, 21))
-> andika(jumla(20, 21))
41
>>> andika(jumla('hello ', '2021'))
-> andika(jumla('hello ', '2021'))
hello 2021
```
## Loops Pyswahili
- while loop
for while loop, we use the swahili keyword **wakati** instead of **while** but the syntax stays the same
to break the loop, use keyword **vunja**
```python
-> x = 3
-> wakati x>0:
... andika(x*10)
... x = x - 1
...
30
20
10
```
## SCRIPT MODE
In script mode, you're supposed to have write your pyswahili code in a file and then pyswahili will run it as whole,
Expand Down

0 comments on commit c41a124

Please sign in to comment.