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
Q1.What is the function of chomp()? | |
ans: This function is use to remove the newline included while recieving input from the user. | |
Q2.Is there a finally block in julia? | |
ans: Yes there is a finally block in julia just like other languages. | |
Q3.To write a file in what mode does the file has to be opened? | |
ans: It can we open many ways : append mode,write mode,read write mode etc. | |
Q4.What does the readline function do? |
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
Q1.How do we define enumeration in julia? | |
ans: We will use the enum keyword to define a enumerate in julia. | |
Q2.How can we access the fields of an enum? | |
ans: we should use :: operator to access the field in an enum. | |
Q3.How to create an object for a structure? | |
ans: varname= structure_name(parameter) , this is the syntax for creating an object of a structure. | |
Q4.What is the use of abstract types in julia? |
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
Q1.What keyword is use to create a function in julia? | |
ans: The function keywors is use to create a function in julia. | |
Q2.What is the syntax for defining a function which accepts varible arguments? | |
ans: syntax: function name(parameter ...) | |
#body | |
end | |
Q3.What is a higher order function in julia? | |
ans: A function which takes function as a parameter or return a function. |
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
Q1.Can a key in dictionary can be of any type? | |
ans: Yes the key can be of any data types and even the values also. | |
Q2.What is the difference between array and set? | |
ans: An array is ordered collection of items whereas set is an unordered collection of items. | |
Q3.Can a set store elements of different data types? | |
ans: Yes a set can stores elements of multiple data types. | |
Q4.How can we delete a key from a dictionary? |
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
Q1. What is the difference between an array and tuples? | |
ans: Arrays are mutables ordered collection of items whereas tuples are immutables ordered collection of items. | |
Q2. What is a Array constructor in julia? | |
ans: Array constructor is function which will help us to create an array of any size or dimension. | |
Q3.What is the use of splice!() function? | |
ans: Splice function can be use to remove and add elements in an array. | |
Q4.What are named tuples? |
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
Q1. What is the use of global keyword? | |
ans: Global keyword is use to access the global variable inside a block or a function. | |
Q2.What does the continue statement do? | |
ans: The continue statement, when the complier encountered the continue statement it will skip the execution of the rest code inside the loop and next iteration will start. | |
Q3.What does the break statememt do? | |
ans: The break statement is used to break out of the loop. | |
Q4. How can write a do while loop in julia? |
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
Q1. Are string mutable in julia? | |
ans: No They are immutable. | |
Q2. How is the indexing of string in julia different from other language? | |
ans: In julia the indexing start from 1 whereas in other languages it start from 0. | |
Q3.How can we access the last character of a string? | |
ans: We can use the end keyword to access the last character of a string. | |
Q4.What is the occurin string use for? |
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
Q1.Can we use increment(++) or decrement(--) operator in julia? | |
ans: We can't use increment or decrement operator, instead julia use shorthand assignment opeartor. | |
Q2.What does the second parameter in the random function defined? | |
ans: It is use to defined the dimension. | |
Q3.What is the syntax of ternary operator in Julia? | |
ans: Syntax: condition ? if true : if false | |
Q4.What is the exponential operator in julia? |
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
Q1. How do we do string interpolation in julia? | |
ans: We use sigil($) in front of the variable name to interpolate it with the string. | |
Q2.How can we take input as an integer? | |
ans: We need to convert the string input to interger using parse function. | |
Q3.Can we define a global variable explicitly(with data type )in julia? | |
ans: No we cannot define a global variable explicitly. | |
Q4.What does the readline function retrun in julia? |
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
Q1. What is the syntax for multiline strings? | |
ans: syntax: <<END; | |
....... | |
....... | |
END | |
Q2.What is the syntax of Substitution operator ( s ): | |
ans: syntax : s/word/pattern/; | |
Q3.What operation does rindex function perform? | |
ans: This function will give the rear/last index of the specific character or a string. |
NewerOlder