in Education by
what will be the output of following python code? flowers=[‘rose’,’lotus’,’lily’] Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
flowers = [‘rose’,’lotus’,’lily’] The above statement helps in creating a list. There will be no output displayed. flowers : variable name [‘rose’,’lotus’,’lily’] : elements of the list To print the elements we need to write print(flowers) Then we will get the output : [‘rose’, ‘lotus’, ‘lily’] To print the first element we need to write print(flowers[0]) Then we will get the output : rose To print the second element we need to write print(flowers[1]) Then we will get the output : lotus To print the third element we need to write print(flowers[2]) Then we will get the output : lily

Related questions

0 votes
    what will be the output of following python code print(‘ab12’.isalnum()) Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    b) What will be the output of the following Python code? print(‘ab12’.isalnum()) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    What will be the output of following python code? flowers =[ rose', lotus', lily' for x in flowers: ... x plsss give write answer Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    what will be the output of following python code? flowers=[‘rose’,’lotus’,’lily’] Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    (a) What will be the output of the following Python code? from math import factorial print (math.factorial (5) ... : print(factorial(5) Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    - What will be the output of the following C code? #include int main() { int i = 97, *p=&i; foo( ... (D) Segmentation fault/code crash Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    what will be the output for the following code fragment: first=2 second=3 third=first*second print(first,second ... third,second,first) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    e)What will be the output of the following code? (2) x,y=4,8 z=x/y*y print(z) Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    What will be the output produced by following code statements? State reason(s). i. (17%5) == (17%5.0) ii. (87 // 5 ... int((87 / 5.0)) Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    What will be the output produced by following code statements? State reason(s). i. (17%5) == (17%5.0) ii. (87 // 5 ... int((87 / 5.0)) Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    What will be the output of following code? (2) Value= Simar Age=17 print(Value, , your are , 17, now but ) ... ,Age+1, next year ) Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    In Java, what will be the output of the following code and how? double x=2.9,y=2.5; (SOP is abbreviated form ... x),y)); Explain how Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2) a) [1, 4] b) [1, 3, 4] c) [4, 3] d) [1, 3]...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='') a) * abcde * b) *abcde * c) * abcde* d) * abcde *...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What will be the output of the following Python code? print("abc. DEF".capitalize()) a) Abc. def b) abc. def c) Abc. Def d) ABC. DEF...
asked Jan 2, 2023 in Technology by JackTerrance
...