Computer Science
Related Questions
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
Observe the code given below and answer the following questions:
n = ............... #Statement 1 if ............... : #Statement 2 print ("Please enter a positive number") elif ............... : #Statement 3 print ("You have entered 0") else: ............... #Statement 4
(a) Write the input statement to accept n number of terms — Statement 1.
(b) Write if condition to check whether the input is a positive number or not — Statement 2.
(c) Write if condition to check whether the input is 0 or not — Statement 3.
(d) Complete Statement 4.
Explain the membership operators in String.