Computer Science
Related Questions
Assertion (A): Indexing in a string is defined as positive and negative indexing.
Reasoning (R): In forward and backward indexing, the indices start with 1st index.
- 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.
Assertion (A): The following code snippet on execution shall return the output as: False True
str1 "Mission 999" str2 = "999" print(str1.isdigit(), str2.isdigit())Reasoning (R): isdigit() function checks for the presence of all the digits in an inputted string.
- 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.
Explain function split() with an example.
How many times is the word 'HELLO' printed in the following statement?
s = "python rocks" for ch in s: print ("Hello")