Soft Computing Lab


Assignment 1
Assignment on basic Python
1. Write a program in python to find all the prime numbers from 1 to 100
 
2. Write a program in python to check whether a number is ARMSTRONG or not.
 
3. Write a program in python to calculate greatest common divisor of a number
 
4. Create a list in python for food items: perform the following tasks on the list
a) Append a new item “Daal Makhni” at the end of the list
b) Add a new item in the 4th position
c) Delete last two items from the list
d) Sort the list according to alphabetical order
e) Traverse the list and print
f) Print the list selectively(Every alternative item)
g) Print the list in reverse order 
 
5. Create a nested list of students having different lists for different class tests
(class test 1 and class test 2). Print the marks of the students in ascending
order. 
 
6. Create a dictionary in python for displaying information of employee (Emp ID,
Emp name, Dept, Designation, Salary). Do the following tasks with the dictionary:
a) Add at least 6 member in emp list
b) Add a new employee details
c) Add a new field called incentives
d) Select the list of employee who is/are getting incentives more than 1000 rs
e) Remove an employee from HR department
f) Select the name of employee who is getting maximum salary
g) Select the name and salary of employee , department wise 
 
7. Create a nested dictionary on python(Student – BCA / MCA)
Perform the following tasks on the nested dictionary:
a) Access the element from nested dictionary
b) Merge two dictionary
c) Remove two items from nested dictionary
d) Remove last inserted item
e) Add an element in a specific position
 
 
************************** *******************************************************************
***********************************************************************************************
 
 
 ASSIGNMENT 2


1.
Write a program in python to create a fuzzy set A with the following value:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
 
 
2.
Write a program in python to perform intersection and union between two fuzzy
sets:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
B={(a1,0.4)(b1,0.6), (a1,0.3)(b1,0.9), (a1,0.5)(b1,0.8)}
 
 
3.
Write a program in python to perform set difference operation between two fuzzy
sets:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
B={(a1,0.4)(b1,0.6), (a1,0.3)(b1,0.9), (a1,0.5)(b1,0.8)}
 
 
4.
Write a program in python to perform complement operation between two fuzzy
sets:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
B={(a1,0.4)(b1,0.6), (a1,0.3)(b1,0.9), (a1,0.5)(b1,0.8)}
 
 
5.
Write a program in python to determine cartesian product of the following fuzzy
set:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
 
 
6.
Write a program in python to perform intersection and union between two fuzzy
relations:
R={(a1,0.45)(b1,0.6), (a1,0.3)(b1,0.8), (a1,0.5)(b1,0.7)}
S={(a1,0.3)(b1,0.7), (a1,0.4)(b1,0.9), (a1,0.8)(b1,1)}
 
 
7.
Write a program in python to perform MAX-MIN operation between two fuzzy
relations:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
B={(a1,0.4)(b1,0.6), (a1,0.3)(b1,0.9), (a1,0.5)(b1,0.8)}
 
 
8.
Write a program in python to perform MAX-PRODUCT operation between two
fuzzy relation:
A={(a1,0.5)(b1,0.7), (a1,0.4)(b1,0.8), (a1,0.6)(b1,0.7)}
 B={(a1,0.4)(b1,0.6), (a1,0.3)(b1,0.9), (a1,0.5)(b1,0.8)}
 
 
******* ************************************************************************************
*******************************************************************************************
 
 
 1.write a program  in python to check whether a number is prime or not

2. write a program in python to calculate intersection between two fuzzy set
A={(a1,0.1)(a2,0.5)                 (a3,0.7)(a4,0.4)}

B={(b1,0.4),(b2,0.6)            (b3,0.3),(b4,0.7)}


3. 1. wap in python to check whether a number is armstrong or not

4. 2. determine union between two fuzzy set
A={(a1,0.2),(a2,0.5)     (a3,0.7,(a4,0.1)}
B={(b1,0.4,(b2,0.2),           (b3,0.6)(b4,0.73)}

Comments

Popular posts from this blog

SOFT COMPUTING MCQS

5 marks qus