r/PowerShell • • Sep 17 '20

PowerShell vs Python Reference

https://blog.ironmansoftware.com/powershell-vs-python/
206 Upvotes

51 comments sorted by

View all comments

2

u/Test-NetConnection Sep 17 '20

Why the hell does python require you to enclose numbers in quotes when casting? That syntax is reserved for strings!

2

u/yardshop Sep 18 '20

It doesn't, those examples just show casting strings to different numerical types.

You can also cast an int to a float or vice versa, either from literals or other variables:

f = float(10)

i = int(f)
i = int(3.14)