Search

ABSTRACT
             Roughness plays a central role in the functional attributes of parts, performance and production costs as well as mechanical properties. It is the main parameter characterizing the quality of a surface, and provides an indication of quality assurance for the manufacturing process. The measurement of engineering surface roughness is becoming increasingly important. Current techniques of surface measurement use surface profilometer to estimate the nature of the surfaces. To overcome the disadvantages arising from the use of the stylus in roughness measurement, several surface analysis techniques have been developed including scanning electron microscopy, near field microscopy, and optical techniques. In this work, a non-contact method using computer vision for inspecting surface roughness of components has been presented.



                                       





                                                            Click here to download full report






ABSTRACT

Our Project discusses an E-quality learning system developed to automatically
measure and monitor the surface roughness of products by utilizing vision
technology. Several methods have been developed to measure surface
roughness in industry. These methods utilize a contact-based approach to
perform the necessary measurements. Our system is developed based on a noncontact
method that uses a smart machine vision camera and Lab VIEW-based
programming. The method for determining the roughness is based on the
correlation of optical roughness parameters and the average surface roughness.
After the surface roughness monitoring system has been built, it can be applied
as an automated quality control system used for educational purposes.







                                                     Click here to download full report
                                            

Abstract:

      The Air Driven Engine is an eco-friendly engine which operates with compressed air. An Air

Driven Engine uses the expansion of compressed air to drive the pistons of an engine An Air

Driven Engine is a pneumatic actuator that creates useful work by expanding compressed

air. There is no mixing of fuel with air as there is no combustion.

     An Air Driven Engine makes use of Compressed Air Technology for its operation The

Compressed Air Technology is quite simple. If we compress normal air into a cylinder the air

would hold some energy within it. This energy can be utilized for useful purposes. When this

compressed air expands, the energy is released to do work. So this energy in compressed air

can also be utilized to displace a piston




                                                     Click here to download full report
def print_board(board):

print "The board look like this: \n"

for i in range(3):
print " ",
for j in range(3):
if board[i*3+j] == 1:
print 'X',
elif board[i*3+j] == 0:
print 'O',
elif board[i*3+j] != -1:
print board[i*3+j]-1,
else:
print ' ',

if j != 2:
print " | ",
print

if i != 2:
print "-----------------"
else:
print

def print_instruction():
print "Please use the following cell numbers to make your move"
print_board([2,3,4,5,6,7,8,9,10])


def get_input(turn):

valid = False
while not valid:
try:
user = raw_input("Where would you like to place " + turn + " (1-9)? ")
user = int(user)
if user >= 1 and user <= 9:
return user-1
else:
print "That is not a valid move! Please try again.\n"
print_instruction()
except Exception as e:
print user + " is not a valid move! Please try again.\n"

def check_win(board):
win_cond = ((1,2,3),(4,5,6),(7,8,9),(1,4,7),(2,5,8),(3,6,9),(1,5,9),(3,5,7))
for each in win_cond:
try:
if board[each[0]-1] == board[each[1]-1] and board[each[1]-1] == board[each[2]-1]:
return board[each[0]-1]
except:
pass
return -1

def quit_game(board,msg):
print_board(board)
print msg
quit()

def main():

# setup game
# alternate turns
# check if win or end
# quit and show the board

print_instruction()

board = []
for i in range(9):
board.append(-1)

win = False
move = 0
while not win:

# print board
print_board(board)
print "Turn number " + str(move+1)
if move % 2 == 0:
turn = 'X'
else:
turn = 'O'

# get user input
user = get_input(turn)
while board[user] != -1:
print "Invalid move! Cell already taken. Please try again.\n"
user = get_input(turn)
board[user] = 1 if turn == 'X' else 0

# advance move and check for end game
move += 1
if move > 4:
winner = check_win(board)
if winner != -1:
out = "The winner is "
out += "X" if winner == 1 else "O"
out += " :)"
quit_game(board,out)
elif move == 9:
quit_game(board,"No winner :(")

if __name__ == "__main__":
main()
raw_input()





                                                                 
#include<iostream.h>
#include<conio.h>
void cgpa_input();
void main()
{
 clrscr();
 cgpa_input();
 getch();
}
void cgpa_input()
{
 int m[15],i,n,mn;
 float g[15],total=0,gtotal=0,cgpa;
 char ma[15],sc[10][15],sem[15],name[15],year[15],dept[15];
 cout<<"\n Enter the student name:";
 cin>>name;
 cout<<"\n Enter the department:";
 cin>>dept;
 cout<<"\n Enter the Year of student:";
 cin>>year;
 cout<<"\n Enter the semester of the student:";
 cin>>sem;
 cout<<"\n Enter the No. of Subjects:";
 cin>>n;
 cout<<"\n Enter the grades in (S-E) F-arrear";
 for(i=0;i<n;i++)
 {
  cout<<"\n Enter the subject code,grades in(S-E),grade points:";
  cin>>sc[i]>>ma[i]>>g[i];
 }
 for(i=0;i<n;i++)
 {
  switch(ma[i])
  {
   case 'S':
   case 's':
  m[i]=10;
  break;
   case 'A':
   case 'a':
  m[i]=9;
  break;
   case 'B':
   case 'b':
  m[i]=8;
  break;
   case 'C':
   case 'c':
  m[i]=7;
  break;
   case 'D':
   case 'd':
  m[i]=6;
  break;
   case 'E':
   case 'e':
  m[i]=5;
  break;
   case 'F':
   case 'f':
  mn=0;
  break;
  }
 }
 if(mn==0)
 {
  clrscr();
  cout<<"\n\tNAME:"<<name<<"\t\tDEPARTMENT:"<<dept<<endl;
  cout<<"\n\tYEAR:"<<year<<"\t\tSEMESTER:"<<sem<<endl;
  cout<<"\n Subject code          Grade";
  for(i=0;i<n;i++)
  {
   cout<<"\n\t"<<sc[i]<<"\t\t"<<ma[i];
  }
  cout<<"\n\nCGPA=ARREAR";
 }
 else
 {
  clrscr();
  cout<<"\n\tNAME:"<<name<<"\t\tDEPARTMENT:"<<dept<<endl;
  cout<<"\n\tYEAR:"<<year<<"\t\tSEMESTER:"<<sem<<endl;
  cout<<"\n Subject code          Grade";
  for(i=0;i<n;i++)
  {
   cout<<"\n\t"<<sc[i]<<"\t\t"<<ma[i];
  }
   for(i=0;i<n;i++)
  {
   total=total+(m[i]*g[i]);
  }
  for(i=0;i<n;i++)
  {
   gtotal=gtotal+g[i];
  }
  cgpa=total/gtotal;
  cout<<"\n\nCGPA="<<cgpa;
 }
}

Output:

Enter the student name:Rajiv Ranjan V
Enter the department:Mechanical
Enter the year of student:4
Enter the semester of the student:7
Enter the No. of  Subjects:8
Enter the grades in (S-E) F-arrear
Enter the subject code:701
Enter the grades in (S-E):S
Enter the grade point:3.5
Enter the subject code:702
Enter the grades in (S-E):A
Enter the grade point:3.5
Enter the subject code:703
Enter the grades in (S-E):A
Enter the grade point:3
Enter the subject code:704
Enter the grades in (S-E):B
Enter the grade point:3
Enter the subject code:705
Enter the grades in (S-E):A
Enter the grade point:3
Enter the subject code:706
Enter the grades in (S-E):A
Enter the grade point:3.5
Enter the subject code:711
Enter the grades in (S-E):S
Enter the grade point:1.5
Enter the subject code:712
Enter the grades in (S-E):S
Enter the grade point:1.5
                    NAME:Rajiv Ranjan V                      DEPARTMENT:Mechanical
                    YEAR:4                                              SEMESTER:7
Subject code                                 Grade
       701                                            S
       702                                            A
       703                                            A
       704                                            B
       705                                            A
       706                                            A
       711                                            S
       712                                            S
CGPA=9.1555555556
Press enter key to exit....





                                                               
Source Code:
def cgpa_display():
total1=0
gtotal=0
grades={"s":"10","S":"10","a":"9","A":"9","b":"8", "B":"8","c":"7", "C":"7","d":"6","D":"6","e":"5","E":"5","f":"4","F":"4"}
name=raw_input("\n Enter the student name:")
dept=raw_input("\n Enter the department:")
year=raw_input("\n Enter the Year of student:")
sem=raw_input("\n Enter the semester of the student:")
n=int(raw_input("\n Enter the No. of Subjects:"))
print"\n Enter the grades in (S-E) F-arrear"
marks=[]
for entry in range(n):
sc=raw_input("\n Enter the subject code:")
ma=raw_input("\n Enter the grades in (S-E):")
g=float(raw_input("\n Enter the grade points:"))
if ma in grades:
m=float(grades[ma])
ma=ma.upper()
entry=(sc,g,m,ma)
marks.append(entry)
if ma=="F":
mn="0"
else:
mn="1"
  if mn=="0":
  print"\n\tNAME:",name,"\t\tDEPARTMENT:",dept
  print"\n\tYEAR:",year,"\t\tSEMESTER:",sem
  print"\n Subject code          Grade"
  for entry in marks:
  sc,g,m,ma=entry
  print"\n\t",sc,"\t\t",ma
            print"\n\nCGPA=ARREAR"
       else:
           print"\n\tNAME:",name,"\t\tDEPARTMENT:",dept
            print"\n\tYEAR:",year,"\t\tSEMESTER:",sem
           print"\n Subject code          Grade"
           for entry in marks:
  sc,g,m,ma=entry
  print"\n\t",sc,"\t\t",ma
  total1=total1+m*g
                gtotal=gtotal+g
  cgpa=total1/gtotal
  print"\n\nCGPA=",cgpa
cgpa_display()
raw_input("\n Press enter key to exit....")

Output:

Enter the student name:Rajiv Ranjan V
Enter the department:Mechanical
Enter the year of student:4
Enter the semester of the student:7
Enter the No. of  Subjects:8
Enter the grades in (S-E) F-arrear
Enter the subject code:701
Enter the grades in (S-E):S
Enter the grade point:3.5
Enter the subject code:702
Enter the grades in (S-E):A
Enter the grade point:3.5
Enter the subject code:703
Enter the grades in (S-E):A
Enter the grade point:3
Enter the subject code:704
Enter the grades in (S-E):B
Enter the grade point:3
Enter the subject code:705
Enter the grades in (S-E):A
Enter the grade point:3
Enter the subject code:706
Enter the grades in (S-E):A
Enter the grade point:3.5
Enter the subject code:711
Enter the grades in (S-E):S
Enter the grade point:1.5
Enter the subject code:712
Enter the grades in (S-E):S
Enter the grade point:1.5
                    NAME:Rajiv Ranjan V                                         DEPARTMENT:Mechanical
                    YEAR:4                                              SEMESTER:7
Subject code                                 Grade
       701                                            S
       702                                            A
       703                                            A
       704                                            B
       705                                            A
       706                                            A
       711                                            S
       712                                            S
CGPA=9.1555555556
Press enter key to exit....



                                                          
Fibonacci Using recursion
#include<stdio.h>
int fib(int n)
{
    static int a=1,b=1,c;
    if(n--)
    {
        c=a+b;
        a=b;
        b=c;
        printf("%d ",c);
        fib(n);
    }
    return 0;
}
main()
{
    static int n=5;
    static int a=1,b=1;
    printf("%d %d ",a,b);
    fib(n-2);
}

Output:
1 1 2 3 5 


Thermal conversion

#include<stdio.h>
int main()
{
    char a[10],c;
     int b,i;
    scanf("%s",a);
    for(i=0;a[i]!='\0';i++)
        {
        if(a[i]=='k'||a[i]=='K')
        {
            b=atoi(a)-273;
            c='C';
        }
        if(a[i]=='c'||a[i]=='C')
        {
            b=atoi(a)+273;
            c='K';
        }
    }
    printf("%d%c",b,c);
    return 0;
}

Output:
45C
318K

318K
45C

Decimal to binary,decimal,octal,hexadecimal conversion using itoa:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int a=54325;
    char buffer[20];
    itoa(a,buffer,2); 
    printf("Binary value = %s\n", buffer);

    itoa(a,buffer,8); 
    printf("Octal value = %s\n", buffer);
    itoa(a,buffer,10);  
    printf("Decimal value = %s\n", buffer);
    itoa(a,buffer,16); 

    printf("Hexadecimal value = %s\n", buffer);
    return 0;
}
Output:
Binary value = 1101010000110101

Octal value = 152065
Decimal value = 54325
Hexadecimal value = D435


Program to separate one integer and find highest occured number
 #include<stdio.h>
int cmp(void *a,void *b)
{
    return (*(int*)a-*(int*)b);
}
main()
{
    int hash[10]={0};
    int a,b,c,d,e[20],i=0,j;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    while(a)
    {
        e[i]=a%10;
        i++;
        a=a/10;
        e[i]=b%10;
        i++;
        b=b/10;
        e[i]=c%10;
        i++;
        c=c/10;
        e[i]=d%10;
        i++;
        d=d/10;
    }
    qsort(e,i,sizeof(int),cmp);
    for(j=0;j<i;j++)
    {
        hash[e[j]]++;
    }
    int max=0;
    for(j=0;j<10;j++)
    {
        if(hash[j]>hash[max])
        {
            max=j;
        }
    }
    printf("%d",max);
}


Output: 
123 456 789 222
2



HCF for multiple numbers : 
 #include<stdio.h>
int main()
{
    int n,x,y=-1;
    printf("\n Enter the no of elements:");
    scanf("%d",&n);
    printf("\nEnter the numbers ");
    while(n--){
         scanf("%d",&x);
    if (y==-1)
         y=x;
        else if (x<y)
             y=gcd(x,y);
         else
             y=gcd(y,x);
    }
    printf("GCD is %d",y);
    return 0;
}

int gcd(int x,int y)
{
    while(x!=y)

 {

  if(x > y) x -= y;

  else y -= x;

 }
        return x;
}

Output:

Enter the no of elements:2
Enter the numbers 12 6
GCD is 6

LCM for multiple numbers :

#include<stdio.h>
int lcm(int,int);
int main()
{
    int a,b=1,n;
    printf("Enter no of integers.");
    scanf("%d",&n);
    printf("Enter positive integers.");
    while(n--)
    {
     scanf("%d",&a);
            if(a>b)
             b = lcm(a,b);
         else
             b = lcm(b,a);
    }

    printf("LCM is %d",b);
    return 0;
}
int lcm(int a,int b)
{
    int temp = a;
    while(1){
         if(temp % b == 0 && temp % a == 0)
             break;
         temp++;
    }
    return temp;
}
Output: 
Enter no of integers.5
Enter positive integers.12 10 32 45 6
LCM is 1440


Program to split String
#include<stdio.h>
main()
{
    char a[100],b[25][25];
    scanf("%[^\n]s",a);
    int i,j=0,k=0;
    for(i=0;i<a[i];i++)
    {
        if(a[i]!='"')
        {
            b[j][k]=a[i];
            k++;
        }
        if(a[i]=='-')
        {
            b[j][k]='>';
            k++;
        }
        if(a[i]==',')
        {
            j++;
            k=0;   
        }
    }
    for(i=0;i<=j;i++)
    {
        printf("%s\n",b[i]);
    }
}

Output:
"vinoth"-"kumar","gokul"-"kannan"
vinoth->kumar,
gokul->kannan

Amicable Numbers:
#include<stdio.h>
int factor(int n);
main()
{
    int i;
    for(i=1;i<=10000;i++)
    {
        if(i==factor(factor(i)))
        {
            printf("%d ",i);
        }
    }

int factor(int n)

 int i,sum=0; 
 for(i=1; i <n; ++i) 
 {
  if (n%i == 0)
  {
   sum=sum+i;
  }
 }
 return sum;
}

Output:
6 28 220 284 496 1184 1210 2620 2924 5020 5564 6232 6368 8128
Lychrel Number:
#include<stdio.h>
int rev(int n);
main()
{
    int i;
    for(i=100;i<=500;i++){
    int n,c=1,pal;
    n=i+rev(i);
    while(c<=50)
    {
        pal=rev(n);
        if(n!=pal)
        {
            n+=pal;
            c++;
        }
        else
        break;
    }
if(c>50)
{
printf("%d ",i);
}
}

int rev(int n)

 int r=0,rem;
    while(n != 0)
    {
        rem= n%10;
        r=r*10+rem;
        n/=10;
    }
    return r;
}

Output:
187 196 286 295 385 394 484 493





                                                                   
Source Code:


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
    int trip,i,x,y,E=0,W=0,N=0,S=0;
    scanf("%d",&trip);
    float dis[trip],speed[trip],total=0;
    char dir[trip];
    for(i=0;i<trip;i++)
    {
        scanf("%f %f %c",&dis[i],&speed[i],&dir[i]);
        total=total+((dis[i]/speed[i])*60);
    }
    printf("%.f\n",ceil(total));  
    for(i=0;i<trip;i++)
    {
        if(dir[i]=='N')
        N=dis[i];
        if(dir[i]=='S')
        S=dis[i];
        if(dir[i]=='E')
        E=dis[i];
        if(dir[i]=='W')
        W=dis[i];
    }
    x=E-W;
    y=N-S;
    if(x>0&&y>0)
    printf("NE");
    if(x<0&&y<0)
    printf("SW");
    if(x<0&&y>0)
    printf("NW");
    if(x>0&&y<0)
    printf("SE");
    if(x==0&&y>0)
    printf("N");
    if(x>0&&y==0)
    printf("E");
    if(x<0&&y==0)
    printf("W");
    if(x<0&&y<0)
    printf("S");
    return 0;
}

Input:
10 20 N 
20 50 E 
5 100 S
Output:
57 
NE






                                     
   Automated Vehicles Using Compressed Air Engine




                                                           Click here to download




  ALTERNATIVE FUEL FOR FUEL CELL POWERED VEHICLES



                                                 



                                                          Click here to download


 Analysing The Factors Affecting Surface Roughness In Abrasive Jet Machining





                                                       Click here to download

  Introduction to Sets                        

Task
        Now, let's use our knowledge of sets and help Mickey.Ms. Gabriel Williams is a botany professor at District College. One day, she asked her student Mickey to compute the average of all the plants with distinct heights in her greenhouse.
Input Format
The first line contains the integer, , the total number of plants.
The second line contains the space separated heights of the plants.
Output Format
Output the average height value on a single line.
Sample Input
10
161 182 161 154 176 170 167 171 170 174
Sample Output
169.375
SOURCE CODE:
num_plants = int(raw_input())
heights =[int(x) for x in raw_input().split()]
heights_list = list(set(heights))
print sum(heights_list) / float(len(heights_list))                

  Symmetric Difference

 

Task
Given sets of integers, and , print their symmetric difference in ascending order. The term symmetric difference indicates those values that exist in either or but do not exist in both.

Input Format
The first line of input contains an integer, .
The second line contains space-separated integers.
The third line contains an integer, .
The fourth line contains space-separated integers.
Output Format
Output the symmetric difference integers in ascending order, one per line.
Sample Input
2 4 5 9
4
2 4 11 12
Sample Output
11 
12  
SOURCE CODE:
m = int(raw_input())
a =[int(x) for x in raw_input().split()]
s=set(a)
n = int(raw_input())
b =[int(x) for x in raw_input().split()]
c=s.symmetric_difference(set(b))
l=[]
for i in c:
    l.append(i)
    l.sort()
for i in l:
    print i

  Set .discard(), .remove() & .pop()

 

Task

You have a non-empty set , and you have to execute commands given in lines.
The commands will be pop, remove and discard.

Input Format
The first line contains integer , the number of elements in the set .
The second line contains space separated elements of set . All of the elements are non-negative integers, less than or equal to 9.
The third line contains integer , the number of commands.
The next lines contains either pop, remove and/or discard commands followed by their associated value.

Output Format
Print the sum of the elements of set on a single line.
Sample Input
1 2 3 4 5 6 7 8 9 
10 
pop 
remove 9 
discard 9 
discard 8 
remove 7 
pop 
discard 6 
remove 5 
pop 
discard 5
Sample Output
4
SOURCE CODE:
n = input()
s = set(map(int, raw_input().split()))
m = int(raw_input())
for _ in xrange(m):
    pair = raw_input().split()
    arg = pair[1] if len(pair) == 2 else ""
    eval("s." + pair[0] + "(" + arg + ")")
print sum(s)

  Set .union() Operation  

   

Task
The students of District College have subscriptions to English and French newspapers. Some students have subscribed only to English, some have subscribed to only French and some have subscribed to both newspapers.You are given two sets of student roll numbers. One set has subscribed to the English newspaper, and the other set is subscribed to the French newspaper. The same student could be in both sets. Your task is to find the total number of students who have subscribed to at least one newspaper.

Input Format
The first line contains an integer, , the number of students who have subscribed to the English newspaper.
The second line contains space separated roll numbers of those students.
The third line contains , the number of students who have subscribed to the French newspaper.
The fourth line contains space separated roll numbers of those students.
Output Format
Output the total number of students who have at least one subscription.
Sample Input
1 2 3 4 5 6 7 8 9 
10 1 2 3 11 21 55 6 8
Sample Output
13 
SOURCE CODE:
m = int(raw_input())
a =[int(x) for x in raw_input().split()]
s=set(a)
n = int(raw_input())
b =[int(x) for x in raw_input().split()]
c=s.union(set(b))
l=[]
count=0
for i in c:
    l.append(i)
for i in l:
    count+=1
print count

  Set .intersection() Operation 

Task
The students of District College have subscriptions to English and French newspapers. Some students have subscribed only to English, some have subscribed only to French, and some have subscribed to both newspapers.You are given two sets of student roll numbers. One set has subscribed to the English newspaper, one set has subscribed to the French newspaper. Your task is to find the total number of students who have subscribed to both newspapers.
Input Format
The first line contains , the number of students who have subscribed to the English newspaper.
The second line contains space separated roll numbers of those students.
The third line contains , the number of students who have subscribed to the French newspaper.
The fourth line contains space separated roll numbers of those students.
Output Format
Output the total number of students who have subscriptions to both English and French newspapers.
Sample Input
1 2 3 4 5 6 7 8 9 
10 1 2 3 11 21 55 6 8
Sample Output
5
SOURCE CODE: 
m = int(raw_input())
a =[int(x) for x in raw_input().split()]
s=set(a)
n = int(raw_input())
b =[int(x) for x in raw_input().split()]
c=s.intersection(set(b))
l=[]
count=0
for i in c:
    l.append(i)
for i in l:
    count+=1
print count

  Set .difference() Operation 

   

Task
Students of District College have a subscription to English and French newspapers. Some students have subscribed to only the English newspaper, some have subscribed to only the French newspaper, and some have subscribed to both newspapers.
You are given two sets of student roll numbers. One set has subscribed to the English newspaper, and one set has subscribed to the French newspaper. Your task is to find the total number of students who have subscribed to only English newspapers.
Input Format
The first line contains the number of students who have subscribed to the English newspaper.
The second line contains the space separated list of student roll numbers who have subscribed to the English newspaper.
The third line contains the number of students who have subscribed to the French newspaper.
The fourth line contains the space separated list of student roll numbers who have subscribed to the French newspaper.
Output Format
Output the total number of students who are subscribed to the English newspaper only.
Sample Input
1 2 3 4 5 6 7 8 9 
10 1 2 3 11 21 55 6 8
Sample Output
4
SOURCE CODE:
m = int(raw_input())
a =[int(x) for x in raw_input().split()]
s=set(a)
n = int(raw_input())
b =[int(x) for x in raw_input().split()]
c=s.difference(set(b))
l=[]
count=0
for i in c:
    l.append(i) 
for i in l:
    count+=1
print count

  Set Mutations

TASK
You are given a set and number of other sets. These number of sets have to perform some specific mutation operations on set .Your task is to execute those operations and print the sum of elements from set . 
Input Format
The first line contains the number of elements in set .The second line contains the space separated list of elements in set .The third line contains integer , the number of other sets.The next lines are divided into parts containing two lines each.The first line of each part contains the space separated entries of the operation name and the length of the other set.The second line of each part contains space separated list of elements in the other set. 
Output Format
Output the sum of elements in set. 
Sample Input 
16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 24 52
4
intersection_update 10
2 3 5 6 8 9 1 4 7 11 update 2
55 66
symmetric_difference_update 5
22 7 35 62 58
difference_update 7
11 22 35 55 58 62 66
Sample Output
38

SOURCE CODE:

n=input()
s = set(raw_input().split())
for _ in range(input()):
    s1 = raw_input().split()
    getattr(s,s1[0])(set(raw_input().split()))
print sum(map(int,s))         

                                                                               

  Check Subset  

              

You are given two sets, and Your job is to find whether set is a subset of set .If set is subset of set , print True.If set is not a subset of set , print False.
Input Format
The first line will contain the number of test cases, .
The first line of each test case contains the number of elements in set .
The second line of each test case contains the space separated elements of set .
The third line of each test case contains the number of elements in set .
The fourth line of each test case contains the space separated elements of set .

Output Format
Output True or False for each test case on separate lines.
Sample Input
1 2 3 5 6 
9 8 5 6 3 2 1 4 7 
3 6 5 4 1 
1 2 3 5 6 8 9 
9 8 2
Sample Output
True 
False 
False
SOURCE CODE: 
for i in range(int(raw_input())):
    a = int(raw_input()); A = set(raw_input().split())
    b = int(raw_input()); B = set(raw_input().split())
    print not bool(A.difference(B))

 Check Strict Superset 


You are given one set and a number of other sets, .Your job is to find whether set is a strict superset of all the sets.Print True, if is a strict superset of all of the sets. Otherwise, print False.A strict superset has at least one element that does not exist in its subset. 
Example:
Set is a strict superset of set.Set is not a strict superset of set.Set is not a strict superset of set.

Input Format
The first line contains the space separated elements of set .
The second line contains integer , the number of other sets.
The next lines contains the space separated elements of the other sets.


Output Format
Print True if set is a strict superset of all other sets. Otherwise, print False.
Sample Input
1 2 3 4 5 6 7 8 9 10 11 12 23 45 84 78 
1 2 3 4 5 
100 11 12
Sample Output
False
SOURCE CODE:
A, n = set(raw_input().split()), int(raw_input())
flag = True
for i in range(n):
    newSet = set(raw_input().split())
    if not (A > newSet):
        flag = False
        break
print flag