Set 1
Set 1
'''
i=10
flt=10.1
str1="Exam"
cmp=10+5j
lst=[1,2,3]
tup=(1,2,3)
dict={1:"aa",2:"bb"}
set1={1,2,3}
print(type(i))
print(type(flt))
print(type(str1))
print(type(cmp))
print(type(lst))
print(type(tup))
print(type(dict))
print(type(set1))
'''
#4 To print the current date in the format “Sun May 29 02:26:23 IST
2017”
'''
import time
ltime=time.localtime()
print(time.strftime("%a %b %d %H:%M:%S %Z %Y",ltime))
'''
'''
'''
#9
# Centigrade to farenheit
celsius=int(input("Enter the celsius :"))
farenheit=1.8*celsius+32
print("Farenheit = ",farenheit)
'''
'''
#10 To construct the Star pattern
n=5
for i in range(n):
for j in range(i):
print ('* ', end="")
print('')
for i in range(n,0,-1):
for j in range(i):
print('* ', end="")
print('')
'''
'''
#11 To print prim numbers less than 20
n=int(input("Enter the value of n : "))
for i in range(2,n+1):
flag=0
for j in range(2,i):
if(i%j == 0):
flag=1
break
if(flag==0):
print(i)
else:
continue
print("end")
'''
'''
#12 To find factorial of a number using recursion
def fact(m):
f1=1
for i in range(1,m+1):
f1=f1*i
return(f1)
'''
#13 To accepts length of three sides of a triangle
opp_side=int(input("Enter the oppsite side :"))
adj_side=int(input("Enter the adjacent side :"))
hyp=int(input("Enter the Hypotenuse side :"))
hyp1=opp_side*opp_side + adj_side*adj_side
if(hyp==hyp1):
print("Given Sides form right angled triangle")
else:
print("Given Sides does not form right angled triangle")
'''
'''
#14 To define a module to find Fibonacci Numbers
def fib(n):
a, b = 0, 1
while b < n:
print(b, end =" ")
a, b = b, a+b
import fibbonacci.fib
n=int(input("Enter the value of n:"))
fibbonacci.fib(n)
'''
'''
#16 Write a script named copyfile.py.
f1=open("E:\\f1.txt","r")
f2=open("E:\\f2.txt","w")
s=f1.read()
f2.write(s)
f1.close()
f2.close()
f3=open("E:\\f2.txt","r")
s=f3.read()
print(s)
f3.close()
'''
'''
#17 Unique words in the file in alphabetical order
f1=open("E:\\f1.txt","r")
s=f1.read().split()
set1=set(s)
print(sorted(set1))
f1.close()
'''
'''
#18 Reverse and Palindrome
s=input("Enter the string:")
s1=s[::-1]
print("Reversed string :",s1)
if(s!=s1):
print("Not a palindrome")
else:
print("Palindrome")
'''