COMPUTER FUNDAMENTALS

COMPUTER SOFTWARE

PROGRAMMING LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Select all that are true about Python.
A
Python was not intended to replace C or C++ for large or time-critical systems.
B
Runtime type-checking is perfectly suitable for time-critical applications.
C
The absence of static type-checking can be a liability in testing and verification of a large software system.
D
The design goal of ease of use for a novice has not been achieved.
Explanation: 

Detailed explanation-1: -Python will always remain a dynamically typed language. However, PEP 484 introduced type hints, which make it possible to also do static type checking of Python code. Unlike how types work in most other statically typed languages, type hints by themselves don’t cause Python to enforce types.

Detailed explanation-2: -Type hinting is not necessary in Python. You can write all your code without ever adding any annotations to your code.

Detailed explanation-3: -Python is a dynamically typed language. That means it is not necessary to declare the type of a variable when assigning a value to it. For instance, you do not need to declare the data type of object major as string when you initialise the object with a string value of ‘Tom’ .

Detailed explanation-4: -Static Typed Language. The type checking of the variable type is done at compile-time. Dynamic Typed Language. The type checking of the variable type is done at run-time. ‘type()’ and ‘isinstance()’ in Python. Duck typing in Python. Type Hint and mypy.

There is 1 question to complete.