Type Function In Python Code Example

Snippet 1

  //Function having two Int parameters with Int return type
fun sum(a: Int, b: Int): Int {
    return a + b
} 

Snippet 2

  public class Main
{
    static void function(){
        System.out.println("I am a function!");
    }
 public static void main(String[] args) {
  function();
 }
} 

Snippet 3

  type()
 

Snippet 4

  #This is able to tell the user what the type of an object is
string_example = "string"
int_example = 1
float_example = 1.1
type_of_string = type(string_example)
#
type_of_int = type(int_example)
#
type_of_float = type(float_example)
# 

Copyright © Code Fetcher 2020

 

 

Leave a comment

Your email address will not be published. Required fields are marked *