15CS664- Python Application Programming- Question bank 1
1. HKBK College of Engineering
15CS664- Python Application Programming- Question Bank-1
1. How to run a python program? Explain
2. Explain building blocks of a program.
3. Explain general types of errors with examples.
4. Explain the following with examples,
a)values and types b)variables c)keywords
5. Predict the output for the following,
a)f1=’10’ b) 7//3 c)3*2**3 d)min(“Welcome to HKBK”) e)3**3 f)2**3+2**3
f2=’20’
print(f1+f2)
g) a=’5’ h) 11//3 i)3+5**2*3/2 j)max(“Welcome to HKBK”) k)(3**3)//2 l)2**3+2**3
b=’2’
c=a+b
print(c)
6. Explain order of operation in python? (Precedence)
7. Explain input() function in python with examples?
8. Explain the following in python with example,
9. a)comments b)input() c)type()
10. Explain the following with examples,
a)logical operators b)Boolean Expression
11. Explain i) infinite Loop 2)finite loop with example code.
12. Explain “continue and break” statements in python with example program.
13. Explain fruitful and void functions in python with example code.
14. Explain different types of looping statements in python with example code.
15. Write python programs for the following,
a. Biggest of 3 numbers
b. Check prime number or not
c. Fibinocci series generation between the range
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
16. Explain how functions are handled in python with example.
17. Explain how to create function with and without parameters in python? Explain with the help of a
program.
18. Explain string functions(methods) with examples.
19. 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])
20. Explain the following a)in operator b)string comparison c)format operators
21. 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