0% found this document useful (0 votes)
49 views3 pages

PLC - QuestionBank Rns

question bank of plc first internal

Uploaded by

freakyzeus28
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)
49 views3 pages

PLC - QuestionBank Rns

question bank of plc first internal

Uploaded by

freakyzeus28
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/ 3

RN SHETTY TRUST®

RNS INSTITUTE OF TECHNOLOGY


Autonomous Institution Affiliated to VTU, Recognized by GOK, Approved by AICTE
(NAAC ‘A+ Grade’ Accredited, NBA Accredited (UG - CSE, ECE, ISE, EIE and EEE)
Channasandra, Dr. Vishnuvardhan Road, Bengaluru - 560 098
Ph:(080)28611880,28611881 URL: www.rnsit.ac.in

Department of Computer Science and Engineering


Subject Name: Introduction to Python Programming (BPLCK105B)

Question Bank Module 1 and 2 (till References)

Note: Refer class notes, learning materials, lab programs and additional programs
taught in the class and laboratory.
1. Explain the data types in python with simple example.
2. List and explain different types of operators in Python.
3. Explain with example code snippet different syntax of range function in python.
4. Demonstrate with an example print(), len(), input() and string replication.
5. Explain the concept of type conversion and math functions in python with example
6. With Python programming examples to each, explain the syntax and control flow diagrams of
break and continue statements.
7. Explain two ways of importing modules into application in Python with syntax and suitable
programming examples.
8. Explain with flowchart if, elif, while and for loop with appropriate examples.
9. Explain looping control statements in Python with a syntax and example to each
10. Write a python program to
a. Find whether number is even or odd.
b. Find whether number positive and negative.
c. Largest of three numbers.
d. Swapping of the two variables values with and without using third variable.
e. Sum of N natural numbers.
11. Write a Python program to find the area of square, rectangle, circle and triangle.
12. A. Define exception handling. Illustrate with an example how exceptions are handled in python?
B. Write a python program with exception handling code to solve divide by zero error situation.
13. Illustrate sys.exit() function with suitable example.
14. What is user-defined functions. Explain with suitable example that how can we pass parameters
using user-defined functions. Compare arguments and parameters in user-defined functions.
15. Explain python functions with and without parameters and return statement.
16. Discuss global scope and local scope with its variables with example.
17. Explain FOUR scope rules of variables in Python

1
18. A. Explain how Tuple is advantageous and different from List.
B. Which function is used to convert list to tuple and tuple to list.
C. How do you create an empty list, empty tuple and a single element tuple?
15. Develop a program to compute binomial coefficient given N and R.
16. Develop a Python program to generate Fibonacci sequence for a given N value.
17. Develop a program to read the student details like Name, Roll Number, and Marks in three
subjects. Display the student details, total marks and percentage with suitable messages.
18. Write a program to display whether the person is a senior citizen or not by reading the name and
year of birth of a person.
19. Explain different ways to insert elements and delete an / all elements from a list with suitable
Python syntax and programming examples.
20. Discuss different methods in List with suitable example.
21. Write the output of the following code:
a. i=1
while i<=10:
print(i)
i=i+1
if i==5:
print("hello")
continue
b. x = 10
y=3
print(x // y)
print(x % y)

c. a = True
b = False
print(a and b)
print(a or b)

d. numbers = [1, 2, 3, 4]
numbers.append(5)
numbers.pop(2)
print(numbers)

e. def find_first(numbers):
for num in numbers:
if num % 2 == 0:
return num
return None
result = find_first([1, 3, 5, 8, 11])
print(result)

2
f. def double_list(values):
return [v * 2 for v in values]
print(double_list([1, 2, 3]))

g. for i in range(1, 10):


if i == 5:
break
print(i)

h. num = [1,2,3,4,5,6,7]
for n in range(len(num)):
print(n)

22. Write a python program to find the product of elements in the list
23. Write a python program to count the Number of Even and Odd Numbers in a List
24. Explain the use of in operator, not in operators, negative indexing and sort() methods in list
with examples.
25. Explain how to get sublists with slice in List with suitable examples. Write the differences
between slices and indexes.
26. Explain list replication and list concatenation with suitable examples.
27. Explain Mutable and Immutable Data types.
28. Explain removing values from Lists with del Statements with examples.
29. Explain the following with suitable examples:
a. Finding the value in the list using index
b. Adding the values into list
c. Create empty list and tuples
d. Remove values in the list
e. Sorting the values list in ascending and descending order
30. Explain converting Types with the list() and tuple() functions with example.
31. Illustrate with an example return value and return statements in python functions.
32. Write a program to guess the number using random function.

*********************************************************************************

You might also like