Which of the following options can be the output for the following code? import random List=["Delhi","Mumbai","Chennai","Kolkata"] for y in range(4): x = random.randint(1,3) print(List[x],end="#")

Question:
 Which of the following options can be the output for the following code?
import random
List=["Delhi","Mumbai","Chennai","Kolkata"]
for y in range(4):
       x = random.randint(1,3)
       print(List[x],end="#")

1. Delhi#Mumbai#Chennai#Kolkata#

2. Mumbai#Chennai#Kolkata#Mumbai#

3. Mumbai#Chennai#Kolkata#Mumbai#

4.Mumbai# Mumbai #Chennai # Mumbai

Posted Date:-2021-12-12 03:00:12


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!