Coder Social home page Coder Social logo

accountreadme's Introduction

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; 
}

accountreadme's People

Contributors

techsplosion avatar

Stargazers

Sabrey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.