In [5]:
import numpy as ns
In [7]:
from numpy.random import randn
In [8]:
randn()
Out[8]:
In [28]:
x=randn()
if x>1:
answer="bigthan1"
print (x)
print(answer)
In [68]:
answer=None
x=randn()
if x>1:
answer="bigthan1"
print (x)
print(answer)
In [86]:
answer=None
x=randn()
if x>1:
answer="bigthan1"
else:
answer="small than1"
print (x)
print(answer)
In [93]:
#nested if
answer=None
x=randn()
if x>1:
answer="bigthan 1"
else:
if x>=-1:
answer="between 1 and -1"
else:
answer="LessThan -1"
print (x)
print(answer)
No comments:
Post a Comment