This file contains hidden or 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
| data = dict() | |
| def add_data(): | |
| while True: | |
| name = input("Name: (type n to exit):") | |
| if name == "n": | |
| break | |
| while True: | |
| number = input("Number: (type n to exit):") |
This file contains hidden or 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
| # Q14 A | |
| string = input() | |
| sub_string = input() | |
| string.count(sub_string) | |
| # Q14 B | |
| # 1. ('b', 'o', 'o', 'k') | |
| # 2. (1, 2, 4) | |
| # 3. ('Riya', 'Riya', 'Riya') | |
| # 4. 74 |
This file contains hidden or 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 | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def hello_world(): | |
| return 'Hello, World!' | |
| if __name__ == '__main__': | |
| app.run() |
This file contains hidden or 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
| # !/usr/bin/python | |
| import smtplib | |
| sender = 'sender@fromdomain.com' | |
| receivers = ['receiver@todomain.com'] | |
| # Your Email Meta Data and your message | |
| message = """ | |
| From: From Person <sender@fromdomain.com> | |
| To: To Person <receiver@todomain.com> |
This file contains hidden or 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 uvicorn # pip install uvicorn | |
| from fastapi import FastAPI # pip install fastapi | |
| from typing import Optional | |
| # Create the FastAPI application | |
| app = FastAPI() | |
| # A simple example of a GET request |
This file contains hidden or 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
| #!/usr/bin/python | |
| import tkinter as tk | |
| # create a instance of Tk | |
| root = tk.Tk() | |
| root.title("Simple GUI App") # title of the window | |
| root.geometry("300x300") # size of the window | |
| # root.resizable(0, 0) # disable resizing the window |
This file contains hidden or 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 pyqrcode # pip install pyqrcode | |
| # pip install pypng | |
| # you need to install pypng if you want to convert the qr code to png | |
| import png | |
| # This creates a QR code for our youtube channel | |
| # Can be any text or URL | |
| QRCode = pyqrcode.create( | |
| 'https://www.youtube.com/channel/UC5GG_qSQ2OgROyc0fRo0KzQ') |
This file contains hidden or 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
| # importing the module | |
| from pytube import YouTube, Playlist | |
| from pathlib import Path | |
| import os | |
| # Global variables | |
| file_size = 0 | |
| def main(): |
This file contains hidden or 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
| DISCORD_TOKEN="Here Goes your discord token" |
This file contains hidden or 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 { Construct } from 'constructs'; | |
| import { App, TerraformStack } from 'cdktf'; | |
| import { AwsProvider, EC2 } from '@cdktf/provider-aws'; | |
| class MyStack extends TerraformStack { | |
| constructor(scope: Construct, name: string) { | |
| super(scope, name); | |
| // define resources here | |
| new AwsProvider(this, 'aws', { |