embedded system,arduino,raspberry pi,msp430f169, ARM7

Tuesday, April 22, 2014

On 11:27 AM by EDUCATION   No comments
this is the simple program take the inputs from the user and process the output using the if elif and else

 x = int(raw_input("Please enter an integer: "))
Please enter an integer: 42
>>> if x < 0:
     x = 0
     print 'Negative changed to zero'
elif x == 0:
print 'Zero'
elif x == 1:
     print 'Single'
print 'More'

//to write in file
//for raspberry pi
sudo nano filename.py
//for beagle bone black
nano filename.py

//for compiling the code
//on raspberry pi
sudo python filename.py
//on beagle
python filename.py


Post a Comment