Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Python (15CS664) Question Bank VI Sem

MODULE-1 QUESTION BANK

1. Describe the hardware architecture of a computer.

2. What is a program? Briefly discuss building blocks of a program.

3. Bring out the difference between an Interpreter and a Compiler.

4. What are various ways in which a Python program can be executed? Discuss.

5. Define variables. What are the rules for naming variables in Python?

6. Write a short note on:

i) Comments in Python ii) ** and // operators iii) Short-circuit evaluation iv) input() Function iv)
Boolean values v) Python keywords vi) Types of Errors vii) Precedence of Operators viii) Built-in
Functions ix) Random Numbers x) Math functions xi) statements xii) string operation.

7. When is a nested condition used? Discuss with an example.

8. Discuss exception handling in Python with an example.

9. What are fruitful functions and void functions? Give examples.

10. Explain the working of python user defined functions along with its syntax.

11. List the uses of functions in Python.

12. List and explain different types error encountered.

13. Explain the conversion of python with example.

14. Explain how the values and types are in python.

15. Explain the Boolean expression and logical operators with example.

16. Explain the following:

i) Conditional execution. ii) Chained conditionals.

17. Explain Syntax errors and Logic errors. Write a program which prompts the user for a Celsius
temperature, convert the temperature to Fahrenheit and print out the converted temperature.
18. Write Pythonic code to multiply two matrices using nested loops and print the result.
19. Explain with syntax the conditional statements of Python.

`
Python (15CS664) Question Bank VI Sem

20. Write a Python program to compute the area of circle: Input the radius of a circle
21.How to run a python program? Explain
22. Explain the following with examples, a)values and types b)variables c)keywords
23.. Predict the output for the following,
a)f1=’10’
f2=’20’
print(f1+f2)

b) 7//3
c)3*2**3
d)min(“Welcome to HKBK”)
e)3**3
f)2**3+2**3 g) a=’5’
b=’2’
c=a+b
print(c)

h) 11//3
i)3+5**2*3/2
j)max(“Welcome to HKBK”)
k)(3**3)//2
l)2**3+2**3
24. Explain order of operation in python? (Precedence)
25. Explain i) infinite Loop 2)finite loop with example code.
26. Explain different types of looping statements in python with example code.
27. Write python programs for the following,
a. Biggest of 3 numbers
b. Check prime number or not
c. Fibinocci series generation between the range

`
Python (15CS664) Question Bank VI Sem

d. Prime numbers generations between the range


e. Bubble Sort
f. Fahrenheit to Celsius
g. Fahrenheit to Celsius
h. Even or odd i. Sum of even numbers
j. Sum of odd numbers
28. Explain how functions are handled in python with example.
29. Explain how to create function with and without parameters in python? Explain with the
help of a program.
30. Explain string functions(methods) with examples.
31. Predict the output of the following,
st=”abcdefg hijkl”
a)print(st[0:5])
b)print(st[6:13])
c)print(st[:])
d)print(st[:2])
e)print(st[2:])
f)print(st[-10])
32. Explain the following a)in operator b)string comparison c)format operators
33. Consider the following python code that stores a string in variable str as, str = “X-DSPAM-
Confidence:0.8475”
a)Use find and string slicing to extract the portion of the string after the colon character.
b)convert the output from above to floating point value.
c)Convert the string str1 to upper case and lower cse letters

You might also like