Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as

(a) Both A and R are true and R is the correct explanation for A

(b)Both A and R are true and R is not the correct explanation for A

(c) A is True but R is False

(d)A is false but R is True

Assertion(A): Python variables do not need to be declared before use

Reasoning(R): Python variables are dynamically typed, meaning they can change their type depending on the value assigned to them.

Answer:

Answer by student

-lock-

The correct choice is (a) Both A and R are true and R is the correct explanation for A

Detailed answer by teachoo

Both A and R are true and R is the correct explanation for A because Python variables do not need to be declared before use, meaning you can assign a value to a variable without specifying its type. 

For example, you can write x = 10 without declaring x as an integer. 

Python variables are also dynamically typed, meaning they can change their type depending on the value assigned to them. 

For example, you can write x = "hello" after assigning x = 10 and x will become a string. 

The reason why Python variables do not need to be declared is because they are dynamically typed, so the type is determined at runtime based on the value.

So, the correct answer is a) Both A and R are true and R is the correct explanation for A.

-endlock-

Remove Ads
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.