Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
import time
t1 = time.time()
a=1
b=5
c=8
sum = a+b+c
t2 = time.time()
print(t2-t1)
0.0
t3 = time.time()
for i in range(10000):
print(i)
t4 = time.time()
print(t4-t3)
class flower():
print("--------Flower Details---------\n")
def __init__(self,name,color,size):
self.name = name
self.color = color
self.size = size
f1 = flower("Rose","Red",1.5)
print(" Name :{}\n Color : {}\n Size : {}\n".format(f1.name,f1.color,f1.size))
f2 = flower("Lotus","Pink",2.5)
print(" Name :{}\n Color : {}\n Size : {}\n".format(f2.name,f2.color,f2.size))
from flask import Flask # Flask is a class
app = Flask(__name__)
@app.route('/get')
def hello_world():
return 'Hello, World!!!!!!!!!!!!!!!!!!!!!!!!!! '
if __name__ == '__main__':
app.run()
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)