step to use if statement:
x = int(input("Enter your integer number: "))
if x < 0:
print ("It is negative")
else:
print ("It is non-negative")
SAVE AND RUN.
REMEMBER: If and Else should be at the same "indentation level".
it will give error if you write:
if blah blah
else blah blah
Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
if statement in python 3.
Posted by
SmoothWayToWorldofPsycho
on Saturday, February 26, 2011
Labels:
programming,
python
0
comments
Python as calculator
Posted by
SmoothWayToWorldofPsycho
Labels:
programming,
python
0
comments
You can use python as a calculator. For example:
width=7;
height=2;
area = width * height;
print = (area);
It shows 14.
width=7;
height=2;
area = width * height;
print = (area);
It shows 14.
Hello World in python 3.
Posted by
SmoothWayToWorldofPsycho
Labels:
programming,
python
0
comments
- Printing 'hello world':
print ("Hello World!")
- write the following text in a text editor whatever you like
print ("Hello World!")
- then, save and run.
It prints "Hello World"
Let's learn Python 3 together!
Posted by
SmoothWayToWorldofPsycho
Labels:
programming,
python
0
comments
It is now one of the most popular programming language. Absolutely it's free to use. It runs on Windows, Mac Os X, Linux/Unix. If want to know more (Click here)
Download it from here. Then installed it by steps in there.