def sum(a, b): | |
return a + b | |
x = sum(3, 4) | |
print(x) # 7 |
# Define the funtion before you use it: | |
def pyth_test (x1, x2): | |
print (x1 + x2) | |
pyth_test(1,2) | |
# Define the class before you use it: | |
class Something: | |
def out(self): | |
print("it works") | |
s = Something() | |
s.out() |
# Creating a Function | |
def my_function(): | |
print("Hello from a function") | |
# Calling a Function | |
def my_function(): | |
print("Hello from a function") | |
my_function() | |
# Python Function: Arguments | |
def my_function(fname): | |
print(fname + " Refsnes") | |
my_function("Emil") | |
my_function("Tobias") | |
my_function("Linus") | |
# Number of Arguments | |
def my_function(fname, lname): | |
print(fname + " " + lname) | |
my_function("Emil", "Refsnes") |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND