Created
August 17, 2017 17:58
-
-
Save thecoducer/ea33a77deebf053e57357186b5cd27ed to your computer and use it in GitHub Desktop.
This file contains 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
//take two variables x and y | |
//x is an integer and y is a float | |
x=50 | |
y=29.3 | |
//declare an array name, arr, with 3 elements | |
//first is a string, second is a function, third is a float | |
//because third is the sum of x and y, must be float | |
arr=<"I'm Mayukh", nimo[]{println "Hello"}, x+y>; | |
//running a loop | |
for[i=0;i<:arr.size[];i++] | |
{ | |
//if any type is function | |
if[arr<i>.type[]=="function"] | |
println "I'm a function" | |
//if float then | |
elseif[arr<i>.type[]=="float"] | |
println "sum: "+arr<i> | |
else | |
println "string: "+arr<i> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment