Question
Choose the correct option.
(a) What is String data-type in Python?
(i) It is written in double quotes only.
(ii) Its value can be changed.
(iii) It is enclosed in square brackets.
(iv) It is immutable data-type.
(b) Ms. Ragini is confused on the way to compare the strings. Help her in choosing the correct statement.
(i) equal() (ii) equals()
(iii) == (iv) compare()
(c) Tejas is confused in the output of the following code. Help him to choose the correct option.
age = 12
txt = "My name is Tejas, I am ", age
print(txt)
(i) ('My name is Tejas, I am ', 12)
(ii) My name is Tejas, and I am 12
(iii) (My name is Tejas, I am , 12)
(iv) [My name is Tejas, I am , 12]
(d) Help mini to choose the correct output of the following Python code.
rollno = 3
name = "Mini "
Average = 88.76
Txt = "My name is {1}, having roll no {0} and scored {2} percent."
print(Txt.format(rollno, name, Average))
(i) My name is ‘Mini ’, having roll no 3 and scored 88.76 percent.
(ii) My name is Mini, having roll no 3 and scored 88.76 percent.
(iii) ‘My name is Mini, having roll no 3 and scored 88.76 percent.’
(iv) (My name is Mini, having roll no 3 and scored 88.76 percent.)
(e) Help Gurnika to choose the correct option for the following Python code.
b = "Hello, World!"
print(b[-5:2])
(i) Hello, World! (ii) orl
(iii) Error (iv) No Output

Answer

(a) (iv) It is immutable data-type.
(b) (iii) ==
(c) (i) ('My name is Tejas, I am ', 12)
(d) (ii) My name is Mini, having roll no 3 and scored 88.76 percent.
(e) (iv) No Output.

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 SQL queries for (a) to (d) and find outputs for SQL queries (e) to (h), which are based on the tables. [CBSE Sample Paper 2017]

TABLE: WATCHES

Watchid Watch_name Price Type Qty_store
W001 High time 10000 Unisex 100
W002 Life time 15000 Ladies 150
W003 Wave 20000 Gents 200
W004 High fashion 7000 Unisex 250
W005 Golden time 25000 Gents 100

TABLE: SALE

Watchid Qty_Sold Quarter
W001 10 1
W003 5 1
W002 20 2
W003 10 2
W001 15 3
W002 20 3
W005 10 3
W003 15 4

(a) To display all the details of those watches whose name ends with ‘time’

(b) To display watch’s name and price of those watches which have price range between 5000-15000

(c) To display total quantity in store of unisex type watches

(d) To display watch name and their quantity sold in first quarter

(e) Select max(price),min(qty_store) from watches;

(f) Select quarter, sum(qty_sold) from sale group by quarter;

(g) Select watch_name,price,type from watches w, sale s where w.watchid=s.watchid;

(h) Select watch_name, qty_store, sum(qty_sold),qty_store

Consider the following tables CARHUB and CUSTOMER and answer (a) and (b) parts of this question: [Delhi 2012]

Table: CARHUB

Vcode Vehicle Name Make Color Capacity Charges
100 Innova Toyota WHITE 7 15
102 SX4 Suzuki BLUE 4 14
104 C Class Mercedes RED 4 35
105 A-Star Suzuki WHITE 3 14
108 Indigo Tata SILVER 3 12

Table: CUSTOMER

CCode CName VCode
1 Hemant Sahu 101
2 Raj Lal 108
3 Feroza Shah 105
4 Ketan Dhal 104

(a) Write SQL commands for the following statements:

(i) To display the names of all white colored vehicles

(ii) To display name of vehicle, make and capacity of vehicles in ascending order of their sitting capacity

(iii) To display the highest charges at which a vehicle can be hired from CARHUB.

(iv) To display the customer name and the corresponding name of the vehicle hired by them.

(b) Give the output of the following SQL queries:

(i) Select count(distinct make) from cabhub;

(ii) Select max(charges), min(charges) from carhub;

(iii) Select count(*), make from carhub;

(iv) Select vehiclename from carhub where capacity = 4;

The Teacher wrote the following code. Sanya was absent on the day when the topic was taught. Help her to complete the assignment. Choose the output on the basis of the above code.
(a) Which statement is used to display “HeLLo PyThon”?
(i) Statement 1 (ii) Statement 12
(iii)Statement 13 (iv) No Statement will display.
(b) Which statement will check for capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(c) Which statement will convert it into capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(d) Which is iterative Statement?
(i) Statement 5 (ii) Statement 6
(iii) Statement 8 (iv)There is No iterative Statement.
(e) What will be the output of Python code (Statement 1 to Statement 13)
(i) HeLLo PyThon (ii) No Output
(iii) hEllO pYtHON (iv) Hello Python
In 1989, Tim Berners Lee, a researcher, proposed the idea of World Wide Web). Tim Berners Lee and his team are credited with inventing Hyper Text Transfer Protocol (HTTP), HTML and the technology for a web server and a web browser. Using hyperlinks embedded in hypertext the web developers were able to connect web pages. They could design attractive webpages containing text, sound and graphics. This change witnessed a massive expansion of the Internet in the 1990s.

(a) HTML is a:

(i)Programming language

(ii)Web server

(iii)Web page

(iv)Browser

(b) What is a web browser?

(i)A program that can display a webpage

(ii)A program used to view HTML documents.

(iii)It enables a user to access the resources of internet.

(iv)All of the above

(c) Dynamic web page _____

(i)is same every time whenever it displays.

(ii)generates on demand by a program or a request from browser.

(iii)both is same every time whenever it displays and generates on demand by a program or a request from browser.

(iv)is different always in a predefined order.

(d) URL stands for _______

(i)unique reference label

(ii)uniform reference label

(iii)uniform resource locator

(iv)unique resource locator

(e) A web cookie is a small piece of data that is _____

(i)sent from a website and stored in user’s web browser while a user is browsing a website

(ii)sent from user and stored in the server while a user is browsing a website

(iii)sent from root server to all servers.

(iv)sent from the root server to another root servers.

Software Development Company has set up its new center at Raipur for its office and web-based activities. It has 4 blocks of buildings named Block A, Block B, Block C, Block (d).

Block Number of Computers
A 25
B 50
C 125
D 10

Shortest distances between various Blocks in meters:

Block A to Block B 60m
Block B to Block C 40m
Block C to Block A 30m
Block D to Block C 50m

(a) Suggest most suitable place to store server of this company.

(i) Block A (ii) Block B

(iii) Block C (iv) Block D

(b) Suggest the topology within the blocks.

(i) Bus (ii) Ring

(iii) Tree (iv) Star

(c) Suggest the placement of the Router in the network.

(i) Block A (ii) Block B

(iii) Block C (iv) Block D

(d) The company wants to design a website for its customers that can be changing the contents as per the responses of customers. What type of website can they design for this purpose?

(i) Static Website (ii) HTML website

(iii) Dynamic Website (iv) Blog

(e) What type of network would be formed if the Raipur office is connected to their New Delhi office?

(i) LAN (ii) PAN

(iii) MAN (iv) WAN

Write SQL commands for the following queries on the basis of Club relation given below:

Relation: Club

Coach-ID CoachName Age Sports date_of_app Pay Sex
1 Kukreja 35 Karate 27/03/1996 1000 M
2 Ravina 34 Karate 20/01/1998 1200 F
3 Karan 34 Squash 19/02/1998 2000 M
4 Tarun 33 Basketball 01/01/1998 1500 M
5 Zubin 36 Swimming 12/01/1998 750 M
6 Ketaki 36 Swimming 24/02/1998 800 F
7 Ankita 39 Squash 20/02/1998 2200 F
8 Zareen 37 Karate 22/02/1998 1100 F
9 Kush 41 Swimming 13/01/1998 900 M
10 Shailya 37 Basketball 19/02/1998 1700 F

(a) To show all information about the swimming coaches in the club.

(b) To list the names of all coaches with their date of appointment (date_of_app) in descending order.

(c) To display a report showing coach name, pay, age, and bonus (15% of pay) for all coaches.

(d) To insert a new row in the Club table with ANY relevant data:

(e) Give the output of the following SQL statements:

(i) Select COUNT(Distinct Sports) from Club;

(ii) Select Min(Age) from Club where SEX = “F”;

Answer the question given below:

Country Expenditure GrowthRate UpdataDate GDP_Growth_rate
0 Australia 1287600000 25.00 2016-07 21.0
1 United States 989300000 24.56 2016-09 19.6

(i) Create the above file in Excel and write the command to create the data frame.

(ii) To print the dataframe.

(iii) To set the index to the column country in the above data frame.

(iv) To add the new data frame in previous question data frame also sort the result.

(v) To change the first row date to 2016-01 for UpdateDate column.

Answer the following question on the basis of given dataset:

a b c d
0 1 2 3 4
1 100 200 300 400
2 1000 2000 3000 4000

(i) To create the data frame for the above dictionary.

(ii) To print the dictionary.

(iii) To change the index of the above data frame 'a1','a2','a3'.

(iv) To change the columns headings to 'units','tens','hundred',' thousand'.

(v) To display the tens columns.

(vi) To create another datframe with values of thousand.

(vii) To use the iterrows() to display the complete records.

(viii) To display the column wise data using iteritems().

Write the output on the basis of the given data frame:

units tens hundred thousand
a1 1 2 3 4
a2 100 200 300 400
a3 1000 2000 3000 4000

The Teacher wrote the following code. Sanya was absent on the day when the topic was taught. Help her to complete the assignment.

Choose the output on the basis of the above code.

(a) Which statement is used to display “HeLLo PyThon ”?

(i) Statement 1 (ii) Statement 12

(iii) Statement 13 (iv) No Statement will display.

(b) Which statement will check for capital letters?

(i) Statement 6 (ii) Statement 7

(iii) Statement 8 (iv) Statement 9

(c) Which statement will convert it into capital letters?

(i) Statement 6 (ii) Statement 7

(iii) Statement 8 (iv) Statement 9

(d) Which is iterative Statement?

(i) Statement 5 (ii) Statement 6

(iii) Statement 8 (iv) There is No iterative Statement.

(e) What will be the output of Python code (Statement 1 to Statement 13)

(i) HeLLo PyThon (ii) No Output

(iii) hEllO pYtHON (iv) Hello Python

Consider the following tables Product and Client. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (vii)

TABLE: PRODUCT

P_ID Product Name Manufacturer Price
TP01 Talcom Powder LAK 40
FW05 FaceWash ABC 45
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120
FW12 Face Wash XYZ 95

TABLE: CLIENT

C_ID ClientName City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Live Life Delhi SH06
15 Pretty Woman Delhi FW12
16 Dreams Bangalore TP01

(i) To display the details of those Clients whose City is Delhi

(ii) To display the details of Products whose Price is in the range of 50 to 100 (Both values included)

(iii) To display the ClientName, City from Table Client, and ProductName and Price from table Product, with their corresponding matching P_ID

(iv) To increase the Price of all Products by 10

(v) SELECT DISTINCT CITY FROM Client;

(vi) SELECT Manufacturer, MAX(Price), Min(Price), Count(*) FROM Product GROUP BY Manufacturer;

(vii) SELECT ClientName, ManufacturerName FROM Product, Client WHERE Client.Prod_Id = Product.P_Id;