Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get random number positive or negative python

import random
return 1 if random.random() < 0.5 else -1
Comment

positive and negative number in python

num = float(input("Enter a number: "))
if num > 0:
   print("Positive number")
elif num == 0:
   print("Zero")
else:
   print("Negative number")
Comment

PREVIOUS NEXT
Code Example
Python :: how to put python code on a website 
Python :: python exec script 
Python :: time difference between two datetime.time 
Python :: add item to python dictionary 
Python :: os file size python 
Python :: python is program running 
Python :: django group with permission 
Python :: append extend python 
Python :: pyqt5 qcombobox get selected item 
Python :: flask authentication user without database 
Python :: how to take first digit of number python 
Python :: how many columns can a pandas dataframe have 
Python :: merge lists 
Python :: paradigm meaning in python 
Python :: export some columns to csv pandas 
Python :: scikit learn train test split 
Python :: python isinstance 
Python :: lamda python 
Python :: live server python 
Python :: python verificar se é numero 
Python :: modulo python 
Python :: sort and remove duplicates list python 
Python :: pandas.core.frame.DataFrame to pandas.core.series.Series 
Python :: python repet x time 
Python :: plot cumulative distribution function (cdf) in seaborn 
Python :: continue statement python 
Python :: python casting 
Python :: try except raise 
Python :: while loop odd numbers python 
Python :: how to open folder in python 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =