Created
April 17, 2022 10:22
-
-
Save kaustubhgupta/c1968b1e5ecc1c55926cd81678b6d789 to your computer and use it in GitHub Desktop.
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 | |
app = Flask(__name__) | |
class Car: | |
def __init__(self, name: str, engine: str) -> None: | |
self.name = name | |
self.engine = engine | |
def getMaxSpeed(self) -> int: | |
if self.name.lower() == 'audi' and self.engine.lower() == 'v2': | |
return 300 | |
elif self.name.lower() == 'tesla' and self.engine.lower() == 'v3': | |
return 250 | |
else: | |
return 100 | |
@app.route('/', methods=['GET', 'POST']) | |
def index(): | |
return render_template('new.html', | |
string_ = 'Kaustubh', | |
integer = 22.45, | |
skills = ['Python', 'Go', 'C++'], | |
dictionary = { | |
"1st_year": 34, | |
"2nd_year": 21, | |
"3rd_year": 64, | |
"4th_year": 43 | |
}, | |
set_1 = {1, 2, 3, 4}, | |
set_2 = {3, 4, 5, 6}, | |
class_ = Car('audi', 'v2') | |
) | |
if __name__ == "__main__": | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment