#Testing Characters
#Variable Declaration
ch=''
#User Input
ch=raw_input("Give any Character as a input: ")
if (ch.isalpha()>0): #Checking whether the character is alphabet
print ch,"is a alphabet"
elif(ch.isdigit()>0): #Checking whether the character is digit
print ch,"is a digit"
else: #else print alphanumeric
print ch,"is a alphanumeric"
#Convert Uppercase to Lowercase and Viceversa
#Variable Declaration
ch=''
#User Input
ch= raw_input("Give the input in lower case or upper case: ")
if(ch.islower()): #Converting lowercase if input is uppercase
print ch.upper(), "is a upper case character"
else: #else print lowercase
print ch.lower(), "is a lower case character"
#Program using input function
scientist=''
scientist = raw_input("Enter Name: ")
print "Print the name: ", scientist
#Count numbers of entered numbers
#Variable declaration
i=0
j=10
k=0
#getting input from user
j=int(raw_input("Give input for j "))
k=int(raw_input("Give input for k "))
i=int(raw_input("Give input for i "))
i= i, j, k #assigning the user input in to a variable
#Result
print "No. of given input values:", len(i) #counting length of the given input
print "The Value of j and k is ", j, k #printing the values of input
#Print a statement using print
print "VRB Publishers" #Printing statement
#Adding two numbers
#variable declaration
a=6
b=8
c= a+b #Adding a, b and stores in c
#Result
print "Addition of two numbers is : ", c
#Reading and Displaying Details of a student
#Variable Declaration
sno=m1=m2=m3=0
name=['20']
total=0
avg=0.0
#User Inputs
sno=int(raw_input("Give Student serial no. "))
name=raw_input("Student Name : ")
m1=int(raw_input("Student Mark 1: "))
m2=int(raw_input("Student Mark 2: "))
m3=int(raw_input("Student Mark 3: "))
total=float(m1+m2+m3) #Calculation of marks
avg="%.2f"%float(total/3.0) #Average
#Result
print '\n'"Student serial No.:", sno
print "Student Name:", name
print "Student's Marks:", m1, m2, m3
print "Total:", total
print "Average:", avg
#Display quotient and reminder of given input
#variable declaration
a=b=q=r=0
#User input
a=int(raw_input("Give input for a: "))
b=int(raw_input("Give input for b: "))
q=float(a/b) #Calculation for Quotient
r=float(a-q*b) #Calculation for Reminder
#Result
print "Quotient of a and b is :",q
print "Reminder of a and b is :",r
#Slope and Midpoint of a line
#Variable declaration
x=x1=y1=x2=y2=slope=0.0
#User input1
x1=int(raw_input("Give point X1: "))
y1=int(raw_input("Give point Y1: "))
#User input2
x2=int(raw_input('\n'"Give point X2: "))
y2=int(raw_input("Give point Y2: "))
slope =(y2-y1)/(x2-x1) #Calculation for Slope
#Calculation for Midpoints
x=float(x1+x2)/2.0
y=float(y1+y2)/2.0
#Result
print '\n' "Slope of a line is :", slope
print "Midpoint of a line is :", x,y
#Average of Given N Numbers
#Variable Declaration
n=0.0
x=0
total=0
avg=0.0
#UserInput
n=int(raw_input("Give total number of input: "))
print "Give those",n ,"Numbers"
for i in range(n): #Looping values of n
i=1
x=input() #Values for n
total+=x # Adding given numbers
avg=float(total/n) #Calculating an average of given numbers
#Result
print "Sum of given numbers is ", total
print "Average is ", avg
#Temperature Conversion (Fahrenheit to Celsius)
#Variable Declaration
F_MIN =0
F_MAX=500
INC=50
fh= F_MIN
print "Fahrenheit" '\t' "Celsius"
while(fh<=F_MAX):
cel ="%.2f"%float((fh-(32.0))/1.8) #Calculating Celsius value
print fh,'\t''\t', cel
fh=fh+INC #Calculating Fahrenheit value
#Area of Triangle
#Variable Declaration
a=b=c=s=area=0.0
#User input
a=int(raw_input("First side of Triangle is "))
b=int(raw_input("Second side of Triangle is "))
c=int(raw_input("Third side of Triangle is "))
s=(a+b+c)/2.0 #Calculating Size of triangle
area="%.3f"%float((s*(s-a)*(s-b)*(s-c)) ** 0.5) #Calculating Area of triangle
#Result
print '\n',"Area of Triangle is",area