Tuesday, September 22, 2015

check triangle and right triangle

# to find out if given sides form a triangle
a=input("enter first side")
b=input("enter second side")
c=input("enter third side")
d=int(a)
e=int(b)
f=int(c)
if d+e>f and e+f>d and f+d>e:
    print("it is atriangle")
else:
    print("not triangle")
if d**2+e**2==f**2 or e**2+f**2==d**2 or d**2+ f**2==e**2:
    print("right angled triangle")

else:
    print("not aright angled")
 

Sunday, August 30, 2015

my first program

[ashok@ashok lab]$ cat hello.py
#!/usr/bin/python
#
print "Hello Everyone"
[ashok@ashok lab]$ ./hello.py
bash: ./hello.py: Permission denied
[ashok@ashok lab]$ ls -l hello.py
-rw-rw-r--. 1 ashok ashok 43 Aug 30 11:57 hello.py
[ashok@ashok lab]$ chmod 764 hello.py
[ashok@ashok lab]$ ls -l hello.py
-rwxrw-r--. 1 ashok ashok 43 Aug 30 11:57 hello.py
[ashok@ashok lab]$ chmod 664 hello.py
[ashok@ashok lab]$ ./hello.py
bash: ./hello.py: Permission denied
[ashok@ashok lab]$ python hello.py
Hello Everyone
[ashok@ashok lab]$

Ashok on the web

This is Ashok.

This is my first feel on www.