Skip to content

Commit d2cbaf9

Browse files
committed
Refine function task descriptions in Python homework files for clarity and consistency
1 parent 37daa58 commit d2cbaf9

11 files changed

+116
-168
lines changed

README.md

Lines changed: 67 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,122 @@
1-
# Basic Function Homework
1+
# Python Basic Functions Homework
22

3+
This repository contains basic Python function exercises to help you practice function creation and return values.
34

4-
Automated grading of homework assignments and tests
5-
- fork this repository
6-
- solve the task
7-
- commit with proper message
8-
- commit with proper message
5+
## Instructions
6+
1. Fork this repository to your own GitHub account
7+
2. Clone your forked repository to your local machine
8+
3. Solve each task in its corresponding Python file
9+
4. Test your solution to make sure it works as expected
10+
5. Commit your changes with a descriptive message
11+
6. Push your changes to your GitHub repository
912

1013
# Problems
11-
## basic_func01
12-
13-
Create a function called main.
1414

15-
**Example 1:**
15+
## basic_func01
16+
Create a function called `return_zero` that:
17+
- Takes no parameters
18+
- Returns the integer value 0
1619

20+
**Example:**
1721
```Python
18-
Input:
19-
Output: 0
20-
22+
return_zero() # Returns: 0
2123
```
2224

2325
## basic_func02
26+
Create a function called `get_hello_world` that:
27+
- Takes no parameters
28+
- Returns the string "Hello World"
2429

25-
Create a function called main.
26-
27-
**Example 1:**
28-
30+
**Example:**
2931
```Python
30-
Input:
31-
Output: "Hello World"
32-
32+
get_hello_world() # Returns: "Hello World"
3333
```
3434

3535
## basic_func03
36+
Create a function called `get_school_name` that:
37+
- Takes no parameters
38+
- Returns the string "codeschooluz"
3639

37-
Create a function called main.
38-
39-
**Example 1:**
40-
40+
**Example:**
4141
```Python
42-
Input:
43-
Output: "codeschooluz"
44-
42+
get_school_name() # Returns: "codeschooluz"
4543
```
4644

4745
## basic_func04
46+
Create a function called `return_integer` that:
47+
- Takes no parameters
48+
- Returns an integer value (either positive or negative)
4849

49-
Create a function called main.
50-
51-
**Example 1:**
52-
53-
```Python
54-
Input:
55-
Output (int): 1
56-
57-
```
58-
59-
**Example 2:**
60-
50+
**Examples:**
6151
```Python
62-
Input:
63-
Output (int): -1
64-
52+
return_integer() # Example return: 1
53+
return_integer() # Example return: -1
6554
```
6655

6756
## basic_func05
57+
Create a function called `return_float` that:
58+
- Takes no parameters
59+
- Returns a floating-point number
6860

69-
Create a function called main.
70-
71-
**Example 1:**
72-
73-
```Python
74-
Input:
75-
Output (float): 1.5
76-
```
77-
78-
**Example 2:**
79-
61+
**Examples:**
8062
```Python
81-
Input:
82-
Output (float): -2.4
63+
return_float() # Example return: 1.5
64+
return_float() # Example return: -2.4
8365
```
8466

8567
## basic_func06
68+
Create a function called `return_string` that:
69+
- Takes no parameters
70+
- Returns any string value
8671

87-
Create a function called main.
88-
89-
**Example 1:**
90-
91-
```Python
92-
Input:
93-
Output (str): "Hello World"
94-
95-
```
96-
97-
**Example 2:**
98-
72+
**Examples:**
9973
```Python
100-
Input:
101-
Output (str): "0"
102-
74+
return_string() # Example return: "Hello World"
75+
return_string() # Example return: "0"
10376
```
10477

10578
## basic_func07
79+
Create a function called `return_same_value` that:
80+
- Takes one parameter `a`
81+
- Returns the same value of `a` without any modification
10682

107-
Create a function called main.
108-
109-
**Example 1:**
110-
111-
```Python
112-
Input: a = 5
113-
Output: 5
114-
115-
```
116-
117-
**Example 2:**
118-
83+
**Examples:**
11984
```Python
120-
Input: a = 0
121-
Output: 0
122-
85+
return_same_value(5) # Returns: 5
86+
return_same_value(0) # Returns: 0
12387
```
12488

12589
## basic_func08
90+
Create a function called `increase_by_one` that:
91+
- Takes one parameter `a`
92+
- Returns the value of `a` increased by 1
12693

127-
Create a function called main.
128-
129-
**Example 1:**
130-
131-
```Python
132-
Input: a = 5
133-
Output: 6
134-
135-
```
136-
137-
**Example 2:**
138-
94+
**Examples:**
13995
```Python
140-
Input: a = 8
141-
Output: 9
142-
96+
increase_by_one(5) # Returns: 6
97+
increase_by_one(8) # Returns: 9
14398
```
14499

145100
## basic_func09
101+
Create a function called `decrease_by_one` that:
102+
- Takes one parameter `a`
103+
- Returns the value of `a` decreased by 1
146104

147-
Create a function called main.
148-
149-
**Example 1:**
150-
151-
```Python
152-
Input: a = 5
153-
Output: 4
154-
155-
```
156-
157-
**Example 2:**
158-
105+
**Examples:**
159106
```Python
160-
Input: a = 8
161-
Output: 7
162-
107+
decrease_by_one(5) # Returns: 4
108+
decrease_by_one(8) # Returns: 7
163109
```
164110

165111
## basic_func10
112+
Create a function called `get_opposite_value` that:
113+
- Takes one parameter `a`
114+
- Returns the opposite (negation) of `a`
166115

167-
Create a function called main.
168-
169-
**Example 1:**
170-
171-
```Python
172-
Input: a = 5
173-
Output: -5
174-
175-
```
176-
177-
**Example 2:**
178-
116+
**Examples:**
179117
```Python
180-
Input: a = 1
181-
Output: -1
182-
118+
get_opposite_value(5) # Returns: -5
119+
get_opposite_value(1) # Returns: -1
183120
```
184121

185122
# Warning

basic_func01.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Create a function called main.
2-
3-
# Return the value 0
1+
# Task: Create a function called return_zero that returns the integer 0
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return the integer value 0

basic_func02.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Create a function called main.
2-
3-
# Return the value "Hello World"
1+
# Task: Create a function called get_hello_world that returns the string "Hello World"
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return exactly "Hello World" as a string

basic_func03.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Create a function called main.
2-
3-
# Return the value "codeacademyuz"
1+
# Task: Create a function called get_school_name that returns the string "codeschooluz"
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return exactly "codeschooluz" as a string

basic_func04.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# Create a function called main.
2-
3-
# Return the value integer type.
1+
# Task: Create a function called return_integer that returns an integer value
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return any integer value (positive or negative)
5+
# Example return values: 1, -1, 0, 42, etc.

basic_func05.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# Create a function called main.
2-
3-
# Return the value float type.
1+
# Task: Create a function called return_float that returns a float value
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return any floating-point number
5+
# Example return values: 1.5, -2.4, 0.0, etc.

basic_func06.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# Create a function called main.
2-
3-
# Return the value str type.
1+
# Task: Create a function called return_string that returns a string value
2+
# Function should:
3+
# 1. Take no parameters
4+
# 2. Return any string value
5+
# Example return values: "Hello World", "0", "Python", etc.

basic_func07.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Create a function called main.
2-
3-
# Create function arguments a.
4-
5-
# Return the value a.
1+
# Task: Create a function called return_same_value that returns its input parameter
2+
# Function should:
3+
# 1. Take one parameter 'a'
4+
# 2. Return the exact same value of 'a' without any modification
5+
# Example: if a=5, return 5

basic_func08.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Create a function called main.
2-
3-
# Create function arguments a.
4-
5-
# Increase the value of a to one and return.
1+
# Task: Create a function called increase_by_one that increases its input by 1
2+
# Function should:
3+
# 1. Take one parameter 'a'
4+
# 2. Add 1 to the value of 'a'
5+
# 3. Return the increased value
6+
# Example: if a=5, return 6

basic_func09.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Create a function called main.
2-
3-
# Create function arguments a.
4-
5-
# decrease the value of a to one and return
1+
# Task: Create a function called decrease_by_one that decreases its input by 1
2+
# Function should:
3+
# 1. Take one parameter 'a'
4+
# 2. Subtract 1 from the value of 'a'
5+
# 3. Return the decreased value
6+
# Example: if a=5, return 4

0 commit comments

Comments
 (0)