This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Arithmetic Operators in Python | |
| # Integers | |
| print('Division without remainder', 7 // 2) # Gives without floating number or without the remainder | |
| print('Modulus', 3 % 2) # Gives the remainder | |
| print('Exponentiation:', 3 ** 2) # it mean 3^2 | |
| print('Mutiplying complex numbers:', (1+1j) * (1-1j)) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Casting(转换):将一种数据类型转换为另一种数据类型 | |
| # int to float | |
| num_int = 10 | |
| print('num_int:', num_int) # 10 | |
| num_float = float(num_int) | |
| print('num_float:', num_float) # 10.0 | |
| # float to int | |
| gravity = 9.81 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Introduction | |
| # Day 1 - 30DaysOfPython Challenge | |
| print(2 + 3) # addition(+) | |
| print(3 - 1) # subtraction(-) | |
| print(2 * 3) # multiplication(*) | |
| print(3 / 2) # division(/) | |
| print(3 ** 2) # exponential(**) | |
| print(3 % 2) # modulus(%) | |
| print(3 // 2) # Floor division operator(//) | 
NewerOlder