Python Forum
Is Python strongly or weakly typed?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is Python strongly or weakly typed?
#2
(Jul-10-2018, 05:31 PM)amandio Wrote: Is Python strongly or weakly typed?
Python is strongly typed.
>>> a = 5
>>> b = '6'
>>> a + b
Traceback (most recent call last):
  File "<string>", line 428, in runcode
  File "<interactive input>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
To read more about it:
Why is Python a dynamic language and also a strongly typed language
Reply


Messages In This Thread
Is Python strongly or weakly typed? - by amandio - Jul-10-2018, 05:31 PM
RE: Is Python strongly or weakly typed? - by snippsat - Jul-10-2018, 06:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't stop keyboard listener to grab chars typed inside CTk window Valjean 9 1,502 Sep-25-2023, 08:07 PM
Last Post: deanhystad
  eliminating letters when typed in python window deebo 0 1,774 Jan-05-2021, 09:26 AM
Last Post: deebo
  ReferenceError: weakly-referenced object no longer exists MrBitPythoner 17 11,815 Dec-14-2020, 07:34 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020