sudo apt-get upgrade
sudo apt-get install build-essential
It works on my ubuntu.
To compile c program
gcc -o hello1 hello1.c
To compile c++ program
g++ -o hello2 hello2.cpp
I wrote about the solutions to some problems I found from programming and data analytics. They may help you on your work. Thank you.
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
def functionname( parameters ): "function_docstring" function_suite return [expression]
Here is a simple example:
def cal1(x,y):
z=x+y
return z
print cal1(5,6)
output:
11
Python naming convention:
1. Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character
variable names.
2. Package and Module Names:
Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.
Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
3. Class names should normally use the CapWords convention.
Basic format of a class in python is like:
class ClassName:
<statement-1>
......
<statement-n>
And in a class, there is an instantiation operation which is for a specific initial state. Therefore a class may define a
special method named
__init__
like this:
def __init__(self):
self.data=[]
But for some of the classes, we can skip the initial steps, i.e. not include __init__ in our class.
After the __init__, we can add more functions.
Here is simple class called Dog:
class Dog:
def __init__(self, name):
self.name = name
self.tricks = [] # creates a new empty list for each dog
def add_trick(self, trick):
self.tricks.append(trick)
And we can start a class instance like below:
d=Dog('Puppy')
And use the function in the class:
d.add_tricks('roll over')
And the original class will change the values:
d.tricks
['roll over']
I am a mid aged woman. I was born in 1980. I do not have any kid. no complicated dating before . I am looking for a man here for marriage...