Skip to content

Commit a582ceb

Browse files
Update examples
1 parent 24f553c commit a582ceb

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

getting-started/repl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ Expected output: `6`
219219

220220
```python
221221
let x = 2
222-
let y = 3
223-
print(x + y)
222+
let z = 3
223+
print(x + z)
224224

225225
let total = 0
226226
for idx in range(4):

language-guide/functions-classes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ def print_banner(text):
186186
print(text.center(40))
187187
print("=" * 40)
188188
# implicit return None
189+
190+
print_banner("Hello")
189191
```
190192

191193
---
@@ -477,9 +479,9 @@ print(temp.fahrenheit) # 32.0
477479

478480
```python
479481
class Vector:
480-
def __init__(self, x, y):
482+
def __init__(self, x, y_val):
481483
self.x = x
482-
self.y = y
484+
self.y = y_val
483485

484486
def __add__(self, other):
485487
return Vector(self.x + other.x, self.y + other.y)

language-guide/syntax.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ def f(
356356
def greet(name, greeting="Hello", times=1):
357357
for _ in range(times):
358358
print(f"{greeting}, {name}")
359+
360+
greet("World")
359361
```
360362

361363
### Type Annotations

reference/numerals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ Multilingual programs can use any supported numeral literal directly:
201201
# English program with Devanagari numeral
202202
let count = ४२ # equivalent to 42
203203
print(count + 8) # 50
204+
```
204205

206+
```python
205207
# French program with Arabic-Indic numeral
206208
soit total = ٣٠ + ١٢
207209
afficher(total) # 42

0 commit comments

Comments
 (0)