Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (1 vote)
51 views

CSE1012 - PROBLEM-SOLVING-USING-PYTHON - ETH - 2.0 - 12 - CSE1012 - Problem Solving Using Python - 2.0

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
51 views

CSE1012 - PROBLEM-SOLVING-USING-PYTHON - ETH - 2.0 - 12 - CSE1012 - Problem Solving Using Python - 2.0

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Course Title: Problem Solving using

Course Code: CSE1012 TPC 3 2 4


Python
Version No. 2.0
Course Pre-requisites/
Co-requisites
None
Anti-requisites (if any). None
1. To understand why Python is a useful scripting language
for developers.
2. To learn how to design and write programs in Python
Objectives:
3. To understand and apply functions with operators, basic
data structures, branching and looping constructs.
4. To learn type conversions and String Operations.
CO-PO Mapping
Course
Course Outcome Statement
Outcomes PO's / PEO's
PO1, PO2, PO3,
CO1 Develop solutions through algorithms and flowcharts
PO4, PO5
Implement simple programs using expressions and PO1, PO2, PO3,
CO2
statements PO5
Apply the concepts of looping statements and regular PO1, PO2, PO3,
CO3
expressions to solve complex problems PO4, PO5, PO6
Analyze the concepts of data structures to deploy solutions PO1, PO2, PO3,
CO4
for real time applications PO4, PO5, PO6
Decide the usage of user defined functions, recursive PO1, PO2, PO3,
CO5
solutions and modules based on the application domain PO4, PO5, PO6
Create applications based on the file processing and string PO1, PO2, PO3,
CO6
concepts PO4, PO5, PO6
TOTAL HOURS OF INSTRUCTIONS: 45
a
Module No. 1 Introduction to Problem Solving 8 Hours
Problem Solving definition and steps, developing an algorithm, flowcharts and
pseudocode, Introduction to Python, Interactive and script mode, Indentation, Comments,
Tokens in Python – Variables, Keywords, Literals, Data types, Expressions, Input and
Print functions.
Module No. 2 Operators and Branching 6 Hours
Operators and its precedence, Arithmetic Operators, Comparison (Relational) Operators,
Assignment Operators, Logical Operators, Bitwise Operators, Membership Operators,
Identity Operators, Branching Statements-if; if else, nested if; nested if else, elif
Module No. 3 Loops and Regular Expressions 7 Hours
Creating Loops with while and for, Different versions of Loops, Nested Loops, Loop
Control Statements, Loop Modification with break, continue and pass, Regular
Expressions.
Module No. 4 Basic Data Structures 8 Hours
Creating, Accessing and Manipulating Lists, Sets, Tuples and Dictionaries,
Understanding the differences among them, Applications of the Data Structures. Using
Branching and Control loops with Data structures, Matrix Operations using Numpy.
Module No. 5 Functions 8 Hours
Pre-defined functions, User defined functions, formal and actual parameters, return
statement, Using Branching, Looping and Data structures in Functions, Recursion,
Internal workflow of Recursion, Modules.
Module No. 6 Working with Numbers, Strings and Files 8 Hours
Introduction to Different Numeric Types, Type Conversion, Mathematical Functions,
Random Numbers. Creating and Accessing Strings, Operations on Strings, Indexing,
Slicing, String Manipulations, Pre-defined functions on Strings.

File I/O-Opening and Closing files, Different modes, File attributes, Read, Write
Operations, File Positions. Renaming and Deleting Files, various directory handling
functions.
Text Books
1. Kenneth Lambert, “Fundamentals of Python: First Programs”, Cengage Learning,
2019
2. Martin C Brown, “The Complete Reference with Python”, McGrawHill, 2018.
References
1. John Zelle, Python Programming: An introduction to Computer Science, Franklin
Associates, Third Edition, 2016.
2. Mark Lutz, “Learning Python”, Fifth edition, O’Reilly, 2013.
List of Laboratory Experiments

Week 1:
1. Write a Python program to display the current date and time.
2. Write a Python program to get the Python version you are using
3. Write a Python program that accepts an integer (n) and computes the value of
n+nn+nnn
4. Write a Python program to read and print various types of variables.
5. Write a Python program to print the calendar of a given month and year.

Week 2:

1. Python Program to Find the Square Root


2. Python Program to Calculate the Area and Perimeter of Triangle and Circle.
3. Python Program to Solve Quadratic Equation
4. Python Program to Swap Two Variables
5. Python Program to Convert Kilometres to Miles
6. Python Program to Convert Celsius To Fahrenheit
Week 3:

1. Python program to find whether the given number is Even or Odd


2. Write a Python program to get the difference between a given number and 17, if
the number is greater than 17 return double the absolute difference
3. Write a Python program to test whether a number is within 100 of 1000 or 2000.
4. Write a Python program to calculate the sum of three given numbers, if the values
are equal then return three times of their sum
5. Python Program to Find the Factorial of a Number
6. Python Program to print maximum of 3 numbers
7. Write a python program to find whether a given year is leap or not.

Week 4:

1. Write a program which will find all such numbers which are divisible by 7 but are
not a multiple of 5, between 2000 and 3200 (both included).
The numbers obtained should be printed in a comma-separated sequence on a single
line. Consider use range(#begin, #end) method
2. Write a python program to check whether a number is divisible by 5 and 11 or not.
3. Write a python program to check whether a character is alphabet or not.
4. Write a python program to input any character and check whether it is alphabet,
digit or special character.
5. Write a python program to check whether a character is uppercase or lowercase
alphabet.
6. Write a python program to input week number and print week day.
7. Write a python program to count total number of notes in given amount

Week 5:

1. Write a Python program to print all natural numbers from 1 to n. - using while loop
2. Write a Python program to find sum of all odd numbers between 1 to n.
3. Write a Python program to count number of digits in a number.
4. Write a Python program to find first and last digit of a number.
5. Write a Python program to calculate sum of digits of a number.
6. Write a Python program to enter a number and print its reverse.

Week 6:
1. Write a Python program to check whether a number is palindrome or not.
2. Write a Python program to find frequency of each digit in a given integer.
3. Write a Python program to print all ASCII character with their values.
4. Write a Python program to find all factors of a number.
5. Write a Python program to calculate factorial of a number.
6. Write a Python program to print all Prime numbers between 1 to n.
7. Write a Python program to check whether a number is Armstrong number or Strong
or Prime Number or Perfect number or magic number or not
8. Write a Python program to print Fibonacci series up to n terms.
Week 7:

1. Write a Python Program to Find the Largest Number in a List


2. Write a Python Program to Find the Second Largest Number in a List
3. Write a Python Program to Put Even and Odd elements in a List into Two
Different Lists
4. Write a Python Program to Merge Two Lists and Sort it
5. Write a Python Program to Sort the List According to the Second Element in
Sublist
6. Write a Python Program to Find the Second Largest Number in a List Using
Bubble Sort
7. Write a Python Program to Sort a List According to the Length of the Elements
8. Write a Python Program to Find the Union of two Lists
9. Write a Python Program to Find the Intersection of Two Lists
10. Python Program to print all odd indexed elements of a list

Week 8:

1. Write a Python program to get the 4th element and 4th element from last of a tuple
2. Write a Python program to find the repeated items of a tuple.
3. Write a Python program to check whether an element exists within a tuple
4. Write a Python program to unzip a list of tuples into individual lists.
5. Write a Python program to replace last value of tuples in a list.
Sample list: [(10, 20, 40), (40, 50, 60), (70, 80, 90)]
Expected Output: [(10, 20, 100), (40, 50, 100), (70, 80, 100)]
6. Write a Python program to remove an empty tuple(s) from a list of tuples.
Sample data: [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]
Expected output: [('',), ('a', 'b'), ('a', 'b', 'c'), 'd']
7. Write a Python program to convert a list of tuples into a dictionary.
8. Write a Python program to find the highest 3 values of corresponding keys in a
dictionary.

Week 9:

1. Write a Python function that prints out the first n rows of Pascal's triangle.
2. Write a Python function to create and print a list where the values are square of
numbers between 1 and 30 (both included).
3. Write a Python program to detect the number of local variables declared in a
function
4. Write a Python program that invoke a given function after specific milliseconds.
5. Write a Python program to get the sum of a non-negative integer
Week 10:

1. Write a Python program to calculate the harmonic sum of n-1


2. Write a Python program to calculate the sum of the positive integers of n+(n-2)+(n-
4)... (until n-x =< 0)
3. Write a Python program to find the greatest common divisor (gcd) of two integers
using Recursion
4. Implement any sorting algorithm using Recursion.

Week 11:

1. Write a Python Program to Replace all Occurrences of ‘a’ with ‘b’ in a String. If ‘a’
is not present, then print appropriate message.
2. Write a Python Program to Remove the nth Index Character from a Non-Empty
String
3. Write a Python Program to Detect if Two Strings are Anagrams
4. Write a Python Program to Form a New String where the First Character and the
Last Character have been Exchanged.

Week 12:

1. Write a Python program to get the last part of a string before a specified character
2. Write a Python program to count the occurrences of each word in a given sentence.
3. Write a Python function to insert a string in the middle of a string.
4. Write a Python function to get a string made of its first three characters of a specified
string. If the length of the string is less than 3 then return the original string.
5. Write a Python program to add a prefix text to all of the lines in a string
6. Write a Python program to convert a given string into a list of words.

A few Programming exercises for Competitive Coding (optional) :

1. Remove Duplicate Char from String


2. Hailstone Sequence
3. Secure Conversation by Encryption and Decryption
4. Special Elements in Matrix
5. Next Greater No with the Same set of Digits
6. Smallest Subarray with Sum Greater than Given Number
7. Group Anagrams
8. Find Duplicates in Array in O(n)
9. Find Two Unique Numbers from Array in O(n)
10. Number Patterns & Finding Smallest Number
11. Minimum Distance for Truck to Deliver Order [Amazon]
12. Generate Balanced Parentheses

Course Type Embedded Theory and Lab (ETL)


Theory – 75%
Continuous Assessment Test-1 15
Continuous Assessment Test-2 15
Mode of Evaluation
Digital Assignments/Quizzes (Min) 30
Final Assessment Test 40
Lab - 25%
Recommended by the th
Board of Studies on
14 BoS, 11.05.2024
Date of Approval by the
Academic Council
12th Academic Council, 25.05.2024

You might also like