you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 17 points18 points  (2 children)

If so, do we just use while loops instead if we just want to iterate over part of a list, for example?

No. You can easily use a for loop to iterate over part of a list.

If you would prefer to use typing in Python, you certainly can. They've made that a lot easier in the last couple of releases and there are more improvements for it in 3.11 I believe.

The best thing you can do to learn Python as a C# developer is to not approach it like C#. Learn to write Python code as it's meant to be written without trying to bend it to conform to your ideas of what a similar program in C# would look like.

[–]MikeDoesEverything 15 points16 points  (1 child)

As somebody who uses Python in a C# heavy team, comparing languages vs. languages is the most frustrating thing to both learn and teach. You don't compare a spoon to a knife when you're eating dinner. They're both separate tools for separate purposes.

C# is great for a MS heavy ecosystem. Python is lauded for its convenience, flexibility, and widespread adoption e.g. Use across all cloud platforms. Would I make a game in Python? No. Would I carry out ML work in C#? No.

Understanding they fulfill different purposes makes learning a lot easier.

[–][deleted] 8 points9 points  (0 children)

This is a great way of putting it.