Techsplosion / AccountReadme

Config files for my GitHub profile.

Home Page:https://github.com/Techsplosion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Old # Introduction Hello guys! I am Techsplosion.
Do
Not
Open
This
I
Swear
There
Is
Nothing
Here
S
t
o
p
I
t
A
l
r
e
a
d
y You can access my YouTube channel at [here](https://www.youtube.com/channel/UCzbYYyFvd5lXhEK_EdnPkTw). I have 200 or so (as of now) subscribers. If you subscribe to me, that would mean a lot. But you don't have to!

Python

Basic

Hello World Program

File helloworld.py

print("Hello world!")

Simple Modulo with User Input (is done with dividing by 2 and the % icon for modulo, the remainder can be 0 or 1 and is outputted)

File modulo.py

i = int(input("Enter a whole number to see the remainder: "))
print(i % 2)

Complicated

Decorators

File decorators.py

def start_end(func):
	def wrapper_se(*args, **kwargs):
		print("Started.")
		func(*args, **kwargs)
		print("Ended.")
		return
	return wrapper_se


@start_end
def print_hi():
	print("Hi!")


print_hi()

Output

Started.
Hi!
Ended.

Complex Imports

Module somepackage\__init__.py

def print_hi():
	print("Hi!")

Module somepackage\other.py

def print_hi_in(inprefix: str):
	inputu = input(inprefix)
	print(f"Hi, {inputu}!")

File cimports.py

import somepackage
from somepackage import other

somepackage.print_hi()
other.printh_hi_in("Enter your name: ")

Test the files and see the output.

Overcomplicated

Site Packages

Discord Mathbot

File pipdiscord.bat

pip install discord

File bot.py

from discord.ext import commands
from math import sqrt

botclient = commands.Bot(command_prefix="mb!")
botclient.remove_command('help')

TOKEN = 'YOUR-TOKEN-HERE'


@botclient.event
async def on_ready():
	print(f"{botclient.user.name} is ready.")


@botclient.command(aliases=["add"])
async def addition(ctx, num1: float, num2: float):
	await ctx.send(str(num1-num2))


@botclient.command(aliases=["subtract"])
async def subtraction(ctx, num1: float, num2: float):
	await ctx.send(str(num1-num2))


@botclient.command(aliases=["multiply"])
async def multiplication(ctx, num1: float, num2: float):
	await ctx.send(str(num1*num2))


@botclient.command(aliases=["divide"])
async def division(ctx, num1: float, num2: float):
	await ctx.send(str(num1/num2))


@botclient.command(aliases=["sqrt"])
async def squareroot(ctx, number: float):
	await ctx.send(str(sqrt(number))


@botclient.command(aliases=["cbrt"])
async def cuberoot(ctx, number: float):
	await ctx.send(str(sqrt(number / 3)))
botclient.run(TOKEN)

C++

I have basic idea about C++.

Basic

Hello World Program

File hworld.cpp

include <iostream>
using namespace std;
int main() {
	cout << "Hello world!" << endl;
}

Simple Modulo with User Input (is done with dividing by 2 and the % icon for modulo, the remainder can be 0 or 1 and is outputted)

File modulo.cpp

include <iostream>
include <string>
using namespace std;
int main() {
	int modulo;
	string prompt = "";
	cout << prompt << endl;
	cin >> modulo;
	cout << modulo % 2 << endl; 
}

About

Config files for my GitHub profile.

https://github.com/Techsplosion