Riju21

2_numeric_value

Mar 27th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. num = 3.775674373
  2. num1 = 2
  3. num2 = 3
  4. num3 = 3.1416j+1   #complex number
  5.  
  6. x = "hello universe"
  7. y = {
  8.     1:'a',
  9.     2:'b'
  10. }
  11.  
  12. print( round( num, 1 ) ) # round
  13. print( type( num ) )   # type of a number
  14. print( num1**num2 )    # power
  15. print( num2 // num1 )  # it will give the floor value 1
  16. print( num1 is num2 ) # true/false
  17. print( 'helo u' in x ) # true/flase
  18. print( 1 in y )   # true/false
  19. print( num3.imag, num3.real )  #imaginary & real part
Advertisement
Add Comment
Please, Sign In to add comment