Skip to content

python Practicas 2 HeidyDB #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .learn/resets/01-Hello-World/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
6 changes: 6 additions & 0 deletions .learn/resets/02-What-is-a-function/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def sum(number1,number2):
return number1 + number2

# Your code here
total = sum(2,3)
print(total)
4 changes: 4 additions & 0 deletions .learn/resets/03-Call-a-function/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def calculate_area(length, width):
return length * width

# Your code below this line
5 changes: 5 additions & 0 deletions .learn/resets/04-Defining-vs-Calling-a-function/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Define below the function called "multi" that expects 2 parameters

# Don't edit anything below this line
return_value = multi(7,53812212)
print(return_value)
2 changes: 2 additions & 0 deletions .learn/resets/05-lambda-functions/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Your function here

5 changes: 5 additions & 0 deletions .learn/resets/06-lambda-function-two/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@



# Your code above, please do not change code below
print(rapid("bob")) # Should print "bo"
7 changes: 7 additions & 0 deletions .learn/resets/07-Function-that-returns/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def dollar_to_euro(dollar_value):
return dollar_value * 0.91

def euro_to_yen(euro_value):
return euro_value * 161.70

####### ↓ YOUR CODE BELOW ↓ #######
7 changes: 7 additions & 0 deletions .learn/resets/08-Function-parameters/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Your code goes here:
def render_person(param):
return param


# Do not edit below this line
print(render_person('Bob', '05/22/1983', 'green', 23, 'male'))
6 changes: 6 additions & 0 deletions .learn/resets/09-Array-Methods/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan']

## CREATE YOUR FUNCTION HERE


print(sort_names(names))
1 change: 1 addition & 0 deletions exercises/01-Hello-World/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Your code here
print("Hello World")
4 changes: 2 additions & 2 deletions exercises/02-What-is-a-function/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ def sum(number1,number2):
return number1 + number2

# Your code here
total = sum(2,3)
print(total)
super_duper = sum(3445324 ,53454423)
print(super_duper)
3 changes: 3 additions & 0 deletions exercises/03-Call-a-function/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ def calculate_area(length, width):
return length * width

# Your code below this line
square_area1 = calculate_area(4,4)
square_area2 = calculate_area(2,2)
square_area3 = calculate_area(5,5)
2 changes: 2 additions & 0 deletions exercises/04-Defining-vs-Calling-a-function/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Define below the function called "multi" that expects 2 parameters
def multi(a,b):
return a*b

# Don't edit anything below this line
return_value = multi(7,53812212)
Expand Down
2 changes: 1 addition & 1 deletion exercises/05-lambda-functions/app.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Your function here

is_odd =lambda num: num % 2 != 0
9 changes: 8 additions & 1 deletion exercises/06-lambda-function-two/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

rapid = lambda stringP: stringP[:-1]


# Your code above, please do not change code below
print(rapid("bob")) # Should print "bo"


'''

Create a lambda function called rapid, which will take one string parameter.

Return the same string with the last letter removed.'''
5 changes: 3 additions & 2 deletions exercises/08-Function-parameters/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Your code goes here:
def render_person(param):
return param
def render_person(name, date, color, age, gender):

return name + " is a " + str(age) + " years old " + gender + " born in " + date + " with " + color+ " eyes"


# Do not edit below this line
Expand Down
5 changes: 5 additions & 0 deletions exercises/09-Array-Methods/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan']

## CREATE YOUR FUNCTION HERE
def sort_names(names):
ordenada= sorted(names)
return ordenada




print(sort_names(names))