forked from Chalarangelo/30-seconds-of-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Chalarangelo#447 from 30-seconds/redate
- Loading branch information
Showing
166 changed files
with
1,039 additions
and
798 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
--- | ||
title: celsius_to_fahrenheit | ||
tags: math,beginner | ||
unlisted: true | ||
--- | ||
|
||
Converts Celsius to Fahrenheit. | ||
|
||
- Follow the conversion formula `F = 1.8 * C + 32`. | ||
|
||
```py | ||
def celsius_to_fahrenheit(degrees): | ||
return ((degrees * 1.8) + 32) | ||
``` | ||
|
||
```py | ||
celsius_to_fahrenheit(180) # 356.0 | ||
``` | ||
--- | ||
title: celsius_to_fahrenheit | ||
tags: math,beginner | ||
unlisted: true | ||
firstSeen: 2020-04-05T12:29:03+03:00 | ||
lastUpdated: 2021-01-04T12:47:04+02:00 | ||
--- | ||
|
||
Converts Celsius to Fahrenheit. | ||
|
||
- Follow the conversion formula `F = 1.8 * C + 32`. | ||
|
||
```py | ||
def celsius_to_fahrenheit(degrees): | ||
return ((degrees * 1.8) + 32) | ||
``` | ||
|
||
```py | ||
celsius_to_fahrenheit(180) # 356.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
--- | ||
title: check_prop | ||
tags: function,intermediate | ||
--- | ||
|
||
Creates a function that will invoke a predicate function for the specified property on a given object. | ||
|
||
- Return a `lambda` function that takes an object and applies the predicate function, `fn` to the specified property. | ||
|
||
```py | ||
def check_prop(fn, prop): | ||
return lambda obj: fn(obj[prop]) | ||
``` | ||
|
||
```py | ||
check_age = check_prop(lambda x: x >= 18, 'age') | ||
user = {'name': 'Mark', 'age': 18} | ||
check_age(user) # True | ||
``` | ||
--- | ||
title: check_prop | ||
tags: function,intermediate | ||
firstSeen: 2020-01-02T16:49:25+02:00 | ||
lastUpdated: 2020-11-02T19:27:07+02:00 | ||
--- | ||
|
||
Creates a function that will invoke a predicate function for the specified property on a given object. | ||
|
||
- Return a `lambda` function that takes an object and applies the predicate function, `fn` to the specified property. | ||
|
||
```py | ||
def check_prop(fn, prop): | ||
return lambda obj: fn(obj[prop]) | ||
``` | ||
|
||
```py | ||
check_age = check_prop(lambda x: x >= 18, 'age') | ||
user = {'name': 'Mark', 'age': 18} | ||
check_age(user) # True | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.