Skip to content

Commit b4ac215

Browse files
docs: add Python Type Casting chapter to tutorial
- Introduced casting using int(), float(), and str() - Covered examples for each conversion type - Included error handling and summary table - Follows structure similar to W3Schools Python Casting guide Co-Authored-By: Sanjay Viswanathan <[email protected]>
1 parent a401baf commit b4ac215

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/python/python-casting.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ tags:
1818

1919
# Python Casting
2020

21-
In Python, **casting** is the process of converting a variable from one type to another.
22-
Python has built-in functions for converting between data types.
21+
In Python, **casting** is the process of converting a variable from one type to another. Python has built-in functions for converting between data types.
2322

2423
---
2524

@@ -43,7 +42,7 @@ Converts a value to an integer. Works with floats and numeric strings.
4342
x = int(1) # 1
4443
y = int(2.8) # 2
4544
z = int("3") # 3
46-
# w = int("abc") # Error
45+
# w = int("abc") # Error
4746
```
4847

4948

0 commit comments

Comments
 (0)