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
class Account { | |
float principal; | |
float rate; | |
int daysActive; | |
int accountType; | |
public static final int STANDARD = 0; | |
public static final int BUDGET = 1; | |
public static final int PREMIUM = 2; | |
public static final int PREMIUM_PLUS = 3; |
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
sudo apt install git ibus libibus-1.0-dev automake autoconf gjs ibus-1.0 gir1.2-ibus-1.0 | |
cd /tmp | |
git clone https://github.com/sarim/ibus-avro.git | |
cd ibus-avro | |
aclocal && autoconf && automake --add-missing | |
./configure --prefix=/usr | |
sudo make install |
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
# using *args | |
args = ("Hello", 1, 2, 3) # set the argument list | |
variable_lenghts_argument_function(*args) # call the function with the argument | |
Output: | |
Normal argument is: Hello | |
Argument pass by *argv is: 1 | |
Argument pass by *argv is: 2 | |
Argument pass by *argv is: 3 |
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
def test_kwargs_argument(**kwargs): | |
for key, value in kwargs.items(): | |
print("Argument pass by **kwargs is: %s = %s" % (key, value)) | |
test_kwargs_argument(name = "Arif", age = 21, department = "ETE") # call the function | |
Output: | |
Argument pass by **kwargs is: age = 21 | |
Argument pass by **kwargs is: department = ETE |
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
def variable_lenghts_argument_function(normal_argument, *argv): | |
print("Normal argument is: ", normal_argument) | |
for argument in argv: | |
print("Argument pass by *argv is: ", argument) | |
variable_lenghts_argument_function("Language", "Python", "Java", "C/C++") | |
Output: |
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
def get_info(name, age): | |
return name, age; | |
name, age = get_info("Arif", 24) | |
print("Name:", name) | |
print("Age: ", age) | |
Output: | |
Name: Arif |
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
def get_info(name = None, age = '21'): | |
return name, age; | |
name, age = get_info(name = "Arif", age = 24) | |
print("Name:", name) | |
print("Age: ", age) | |
Output: | |
Name: Arif |
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
" Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim | |
" file for all possible options: | |
let g:spacevim_default_indent = 4 | |
let g:spacevim_max_column = 80 | |
" Change the default directory where all miscellaneous persistent files go. | |
" By default it is ~/.cache/vimfiles. | |
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles' | |
" set SpaceVim colorscheme |
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
def infinity_fibonacci_numbers(): | |
a, b = 0, 1 | |
while True: | |
yield a | |
a, b = b, a + b | |
# import sys | |
# print (sys.maxsize) | |
import itertools |
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
# initilize a list | |
my_list = [1, 3, 5, 8, 11, 21] | |
# square each element of our list using list comprehension | |
square_of_my_list = [x**2 for x in my_list] | |
# print list | |
print("list:", square_of_my_list) | |
# একই কাজ generator expression এর মাধ্যমেও করা যায় |