Computer Science
Assertion (A): In Python, a variable can hold values of different types at different times.
Reason (R): Once assigned, a variable's data type remains fixed throughout the program.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python Funda
2 Likes
Answer
A is true but R is false.
Explanation
In Python, variables are dynamically typed, so they can hold values of different types at different times. This means that a variable's data type is not fixed once assigned, and Python allows changing the type of a variable during the program's execution.
Answered By
2 Likes
Related Questions
Srishti is down with fever, so she decides not to go to school. The next day, she calls up her classmate Shaurya and enquires about the computer class. She also requests him to explain the concept taught in the class. Shaurya quickly downloads a 2-minute video clip from the internet explaining the concept of Tuples in Python. Using video editor, he adds this text in the downloaded video clip: "Prepared by Shaurya". Then, he emails the modified video clip to Srishti. This act of Shaurya is an example of:
- Fair use
- Hacking
- Copyright infringement
- Cyber crime
…………… are the records and traces individuals leave behind as they use the internet.
- Digital footprints
- Cookies
- Website
- URL
Assertion (A): Python lists allow modifying their elements by indexes easily.
Reason (R): Python lists are mutable.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Convert the following binary numbers into decimal:
(a) 10010
(b) 101010