Skip to content

Instantly share code, notes, and snippets.

View menon92's full-sized avatar
🏠
Working from home

Mehadi Hasan Menon menon92

🏠
Working from home
View GitHub Profile
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;
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
# 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
@menon92
menon92 / kw-4.py
Last active January 23, 2018 08:08
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
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:
def get_info(name, age):
return name, age;
name, age = get_info("Arif", 24)
print("Name:", name)
print("Age: ", age)
Output:
Name: Arif
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
" 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
def infinity_fibonacci_numbers():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
# import sys
# print (sys.maxsize)
import itertools
# 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 এর মাধ্যমেও করা যায়