Question
Based on the following python code, find out the expected correct output(s) from the options (i) to (iv)
import random
lst=["Red","Blue","Green","Yellow"]
for i in range(5,2,-1):
print(lst[random.randint(1,2)],end="%")
(i) Blue%Green%Green%
(ii) Blue%Red%Green%
(iii) Blue%Green%Yellow%
(iv) Blue%Blue%Red%

Answer

(i)

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write a program to create a duplicate copy of the file. 

Differentiate between DDL &DMLcommands. Identify DDL &DML commands from the following:

(UPDATE, SELECT, ALTER, DROP)

Name two threats to security in a network . What is the role of Firewall in Network security?
Write a program to read the records from laps.csv.
What is the basic difference between Trojan Horse and Computer Worm? 

Write SOL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) which are based on the tables.

TABLE : CUSTOMERS

NO CNAME ADDRESS
101 Richa jain Delhi
101 Surbhi Sinha Chennai
103 Lisa Thomas Bangalore
104 Imran Ali Delhi
105 Roshan Singh Chennai

TABLE : TRANSACTION

TRNO CNO AMOUNT TYPE DOT
T001 101 1500 Credit 2017-11-23
T002 103 2000 Debit 2017-05-12
T003 102 3000 Credit 2017-06-10
T004 103 12000 Credit 2017-09-12
T004 101 1000 Debit 2017-09-05

(a) To display details of all transactions of TYPE Credit from Table TRANSACTION.
(b) To display the CNO and AMOUNT of all transactions done in the month September 2017 from the table TRANSACTION.
(c) To display the last date of transaction (DOT) from the table TRANSACTION for the customer having CNO as 103.
(d) To display all CNO,CNAME and DOT (date of transaction) of those CUSTOMERS from tables CUSTOMERS and TRANSACTION who have done transactions more than or equal to 2000.
(e) Select count(*), avg(amount) from transaction where dot>= ‘2017-06-01’;
(f) Select cno, count(*), max (amount) from transaction group by cno having count(*)> 1;
(g) Select cno, cname from customer where address not in (‘Delhi, ‘Bangalore’);
(h) Select distinct cno from transaction;

What are candidate keys in a table? Give a suitable example of candidate keys in a table.
Write the program using function to count the lower case vowel in the file “India.txt”.
What is the basic difference between Trojan Horse and Computer Worm?

Write the output produced by the following SQL commands: