0% found this document useful (0 votes)
12 views13 pages

Practice Questions (QB)

The document contains a series of programming and computer science questions, including topics such as immutability, list slicing, memory types, variable naming conventions, tokens in Python, and security concerns related to data deletion. It also includes coding exercises and output predictions for given Python code snippets. Additionally, there are practical programming tasks related to age verification and calculating working capital.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

Practice Questions (QB)

The document contains a series of programming and computer science questions, including topics such as immutability, list slicing, memory types, variable naming conventions, tokens in Python, and security concerns related to data deletion. It also includes coding exercises and output predictions for given Python code snippets. Additionally, there are practical programming tasks related to age verification and calculating working capital.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

PART – 4

1. What do you mean by immutable? Explain with the help of an example.


2. Write a slicing statement which will return the list „L1‟inreverse order?
3. Write a slicing statement which will return the first three characters of a list LIST?
4. What will be the output of the following expression?
10* ( 8%4 ) // 2 + 6
5. Differentiate between the following:
i. Primary Memory and Secondary memory
ii. “=” and “==”
iii. RAM and ROM
iv. “/” and “//”
6. Suppose list1 is [10,20,30,40,50,60], What will list1[:-1] return?

7. identify the invalid variable name and specify the reason?


WHILE, Cut_1, 12A, A#b

8. Define Tokens. Explain any two types of tokens used in python.


9. Sameer has discarded old, broken and malfunctioning Hard Disk without taking care to delete
data. Is it harmful in respect of security concern? Justify your answer.
10. Will the following code produce any result? Justify your answer.
language=*‘Python’, ‘Java’, ‘C++’+
for language in lang:
print(lang)

11. Find out the output:


i. sampleList = [10, 20, 30, 40, 50]
print(sampleList[-2])
print(sampleList[4:1])

ii. a = [11,42,31,14]
print(max(a))
print(min(a))
print(a.remove(42))

iii. Nm=*“Smaridhi”,”ashish”,”Naved”,”preet”+
print(Nm[-1][-1])
iv. print( 2 * “IP” + “2022”)
print( “2022” + (“IP” * 3))
v.

12. Write a python program to accept age of a person from user and check whether he has completed 18
years or more. If yes print „Eligible for Voting‟ or otherwise print „Minor‟.
13. Write a program to calculate working capital for company A that has cash of aboutRs2,50,000,
Accounts received of about Rs 1,50,000 and inventories of about Re 5,00,000. Company A also
has accounts payable of Rs 3,00,000, short term borrowings of Re. 75,000 and accrued
liabilities of about Rs. 1,25,000
Hint: Working Capital = Current assets- Current liabilities

You might also like