Hi All,
we will start from basics.
Qn) Read two numbers, find sum and display output.
first.py
---------------------------------------------------------------------------------------
print("Enter two numbers")
n1=input("First Number")
n2=input("Second Number")
print 'sum of', n1, 'and',n2, 'is ', n1+n2
---------------------------------------------------------------------------------------
Save this file as first.py
Now come to command prompt and come to your folder.
Type 'ls' to check whether your file first.py is in your present working directory
Then type the command : python first.py
gurst@dell:~$ python first.py
Now see the output
we will start from basics.
Qn) Read two numbers, find sum and display output.
first.py
---------------------------------------------------------------------------------------
print("Enter two numbers")
n1=input("First Number")
n2=input("Second Number")
print 'sum of', n1, 'and',n2, 'is ', n1+n2
---------------------------------------------------------------------------------------
Save this file as first.py
Now come to command prompt and come to your folder.
Type 'ls' to check whether your file first.py is in your present working directory
Then type the command : python first.py
gurst@dell:~$ python first.py
Now see the output
No comments:
Post a Comment