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
import datetime | |
class Reply: | |
def __init__(self, body: str, user: str, created: datetime.datetime) -> None: | |
self.body = body | |
self.user = user | |
self.created = created | |
def __repr__(self) -> str: |
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
3.11 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>I'm learning HTML and CSS!</h1> | |
<p>Hello, my name is Rolf Smith. I'm learning about web development, and I'm starting with HTML and CSS.</p> | |
<p>With HTML and CSS, I can make all sorts of websites. HTML and CSS are the most important languages to learn!</p> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<img class="profile" src="profile.png" alt="Rolf's profile picture." /> | |
<h1>I'm learning HTML and CSS!</h1> | |
<p>Hello, my name is Rolf Smith. I'm learning about web development, and I'm starting with HTML and CSS.</p> | |
<p>With HTML and CSS, I can make all sorts of websites. HTML and CSS are the most important languages to learn!</p> | |
<p>This website's code looks like this:</p> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" | |
/> | |
<title>Rolf Smith - Learning HTML</title> | |
<link rel="stylesheet" href="style.css" /> |
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
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
transactions = [] | |
@app.route("/", methods=["GET", "POST"]) | |
def home(): | |
print(request.form) | |
return render_template("form.html") |
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
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
@app.route("/", methods=["GET", "POST"]) | |
def home(): | |
print(request.form) | |
print(request.form.get("account")) | |
return render_template("form.html") |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Personal finance</title> | |
<link rel="stylesheet" href="./style.css" /> | |
</head> | |
<body> | |
<h1>Add transaction</h1> | |
<form> |
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
from unittest import TestCase | |
from typing import List | |
def has_mixed_types(list_: List): | |
first = type(list_[0]) | |
return any(not isinstance(t, first) for t in list_) | |
def reverse_list(original: List) -> List: | |
if has_mixed_types(original): | |
raise ValueError("The list to be reversed should have homogeneous types.") |
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
import smtplib | |
from email.message import EmailMessage | |
email = EmailMessage() | |
email['Subject'] = 'Test email' | |
email['From'] = '[email protected]' | |
email['To'] = '[email protected]' |
NewerOlder