Python Question Bank
Python Question Bank
UNIT II
UNIT III
1. What is full form of CSV.
2. What is RDBMS. Give Examples.
a. 1. Create following Variables
b. i) „mystring‟ to contain „hello‟
c. ii) „myfloat‟ to contain „2.5‟
d. iii) „myint‟ to contain „10‟
e. 2. Write the value justification i) 2*(3+4) ii) 2*3+4 iii) 2+3*4
3. What is the type of the following result: i) 1+2.0+3
4. Which of the following is the valid variable name: i) global ii) 99flag iii) sum iv) an$wer
5. Which lines are commented? i) “””This is a comment””” ii) # This is a comment iii) // this is a
comment v) „ „ „ This is a comment‟ „ „
6. MCQ i) The __________ data type allows only True/False values a) bool b) boolean c) Boolean
d) None ii) If the value of a = 20 and b = 20, then a+=b will assign ________ to a a) 40 b) 30 c) 20
d) 10 iii) The ____________ operator is used to find out if division of two number yields any
remainder a) / b) + c) % d) //
What does „immutable‟ mean; which data type in python are immutable.
7. Name four of Python‟s Basic data types? Why are they called so?
8. What are relational operators? Explain with the help of examples.
9. What is an integer?
10. What is a variable? What names may variable have?
11. How are keywords different from variable names?
12. Why are data types important?
13. How can you convert a string to integer and when can it be used?
14. How can text be read from the keyboard? 20. How are comments written in a program?
15. Define a function get Bigger Number (x,y) to take in two numbers and return the bigger of
them.
Functions:
16. What is the difference between methods, functions & user defined functions.
17. Open help for math module i. How many functions are there in the module? ii. Describe how
square root of a value may be calculated without using a math module iii. What are the two data
constants available in math module.
18. Generate a random number n such that i. 0 ≤ n < 6 ii. 2 ≤ n < 37 and n is even
19. Write a program to ask for following as input Enter your first name: Rahul Enter your last
name: Kumar Enter your date of birth Month? March Day? 10 Year? 1992 And display following
on screen Rahul Kumar was born on March 10, 1992.
20. Write a Python function, odd, that takes in one number and returns True when the number is
odd and False otherwise. You should use the % (mod) operator, not if.
21. Define a function „SubtractNumber(x,y)‟ which takes in two numbers and returns the
difference of the two.
22. Write a Python function, fourthPower( ), that takes in one number and returns that value
raised to the fourth power.
23.Write a program that takes a number and calculate and display the log, square, sin and cosine
of it.
24. a) Write a program, to display a tic-tac-toe board on screen, using print statement. b) Write a
program to display a tic-tac-toe board on screen using variables, so that you do not need to write
many print statements?
UNIT IV
1.What is SQL?
2.Differentiate between DDL and DML?
3.What is a constraint?
4.What are single row functions ?
5.A table "Animals" in a database has 3 columns and 10 records. What is the degree and rdinality of this
table?
6. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the Cust_Name ends with
'Sharma
7.How primary key is different from unique key.
8.What do you mean by foreign key .
9.What is select and projection operation .
10.What are indexes.
11.What do you mean by DBMS.
12.Why do we need DBMS.
13.How to insert a row in a table.
14.What are joins . Explain its types.
15.Display the name of all students whose stream is not Science
Unit V (Cyber safety)
1. What are the precautions required while browsing a site.
2. What is the use of CAPTCHA .
3. What is an authentic and authorized user .
4. List some positive and negative impact of social networking sites.
5. What is cyber troll.
6. List some popular social networking sites.
7. What are the ethics related to social networking .
8. Difference between Adware and malware.
9. Which of the following seems non harmful
i)Trojan ii) Virus
10. What are the types of Viruses.
11. How we will come to know the site secure for financial transaction
12. What do you mean by phishing .
13. What are the hardware & software requirements to browse a site safely
14. Differentiate Hacking and Cracking .
15. What do you mean by Eavesdropping and Snooping .