This repository contains basic Python function exercises to help you practice function creation and return values.
- Fork this repository to your own GitHub account
- Clone your forked repository to your local machine
- Solve each task in its corresponding Python file
- Test your solution to make sure it works as expected
- Commit your changes with a descriptive message
- Push your changes to your GitHub repository
Create a function called return_zero
that:
- Takes no parameters
- Returns the integer value 0
Example:
return_zero() # Returns: 0
Create a function called get_hello_world
that:
- Takes no parameters
- Returns the string "Hello World"
Example:
get_hello_world() # Returns: "Hello World"
Create a function called get_school_name
that:
- Takes no parameters
- Returns the string "codeschooluz"
Example:
get_school_name() # Returns: "codeschooluz"
Create a function called return_integer
that:
- Takes no parameters
- Returns an integer value (either positive or negative)
Examples:
return_integer() # Example return: 1
return_integer() # Example return: -1
Create a function called return_float
that:
- Takes no parameters
- Returns a floating-point number
Examples:
return_float() # Example return: 1.5
return_float() # Example return: -2.4
Create a function called return_string
that:
- Takes no parameters
- Returns any string value
Examples:
return_string() # Example return: "Hello World"
return_string() # Example return: "0"
Create a function called return_same_value
that:
- Takes one parameter
a
- Returns the same value of
a
without any modification
Examples:
return_same_value(5) # Returns: 5
return_same_value(0) # Returns: 0
Create a function called increase_by_one
that:
- Takes one parameter
a
- Returns the value of
a
increased by 1
Examples:
increase_by_one(5) # Returns: 6
increase_by_one(8) # Returns: 9
Create a function called decrease_by_one
that:
- Takes one parameter
a
- Returns the value of
a
decreased by 1
Examples:
decrease_by_one(5) # Returns: 4
decrease_by_one(8) # Returns: 7
Create a function called get_opposite_value
that:
- Takes one parameter
a
- Returns the opposite (negation) of
a
Examples:
get_opposite_value(5) # Returns: -5
get_opposite_value(1) # Returns: -1
- don't copy other solutions or any solution
- don't remove comments