What are some basic conceptual differences between C # and Python?

I am new to Python based on C # background and I am trying to speed up. I understand that Python is dynamically typed, and C # is strongly typed. โ†’ see comments. What conceptual obstacles should I follow when trying to learn Python? Are there concepts for which an analog does not exist in Python? How important is object oriented analysis?

I believe that answering these and any other questions you might think would speed up my understanding of Python besides the Nike mentality (โ€œjust do itโ€)?

A bit more context: my company is moving from ASP.NET C # Web Forms to Django. I went through a Django tutorial and it was really great. I need to speed up after about 2 weeks (funny maybe lol)

Thank you all for your time and efforts to answer an increasingly wide question (questions).

+3
source share
5 answers

"I understand that Python is dynamically typed and C # is strongly typed."

This is strangely wrong.

  • Python is strongly typed. A list or integer or dictionary is always of a given type. The type of object cannot be changed.

  • Python . , Python - . ; , Python "".

  • # . . .

Python "" - - . [ Python -. , .]

# - .


Python?

. , Python - ; , - , .

. , .

, Python?

Python -, , -, Python.

- ?

OO - OO. Python .

2 (, ?)

, . , , Python .

, , Python #, , # Python. # Python. Python #.

.

+9

, , #/java python, , . , python ducktyping.

class Duck(object):
    def quack(self):
        print "quack"

class Cat(object):
    """Cat that specializes in hunting ducks"""
    def quack(self):
        print "quack"

duck = Duck()
cat = Cat()

def quacker(something_that_quacks):
    something_that_quacks.quack()

quacker(cat) #quack
quacker(duck) #quack

, quack OK, . . , .

+4

# Python ; , , , , Python , Dive Into Python. , Python , . , ( Django - ).

WebForms Django. Django HTTP - , , . WebForms . ASP.NET Ajax- , , . Django , , , , YUI jQuery Ajax. , , ASP.NET, Django Python, . ASP.NET , WinForms ; Microsoft, ( , , Java JSF), HTTP REST . , , URL ASP.NET(pre ASP.NET MVC) URL- Django.

2 : -)

+3

, Python , # , . . , str + int opperands, Python # ( PHP C ). Python , , , # .

+2

, , .

" ". .., , , . , . " , , ". .

  • . , , - , , - , 8.

  • , , . , , , . , .

+1
source

Source: https://habr.com/ru/post/1716385/


All Articles