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
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main () { | |
string fileName; | |
string fileType; | |
string fileText; | |
cout << "Please enter the information in the file >"; |
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
#include <math.h> | |
#include <stdio.h> | |
float calculateSD(float data[]); | |
int main() { | |
int i; | |
float data[10]; | |
printf("Enter 10 elements:"); | |
printf("\n"); | |
for (i = 0; i < 10; ++i) | |
scanf("%f", &data[i]); |
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 json | |
import turtle | |
import urllib.request | |
import time | |
import webbrowser | |
import geocoder | |
url = "http://api.open-notify.org/astros.json" | |
response = urllib.request.urlopen(url) | |
result = json.loads(response.read()) |
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
<?php | |
function printCollatz($n) | |
{ | |
while ($n != 1) | |
{ | |
echo $n . " "; | |
if ($n & 1) | |
$n = 3 * $n + 1; | |
else | |
$n = $n / 2; |
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
const fs = require("fs") | |
const strip = require("strip-comments") | |
const prettier = require("prettier") | |
var glob = require("glob") | |
try { | |
glob("**/*.js", { ignore: "**/node_modules/**" }, function (error, files) { | |
files.forEach((element) => { | |
var file = fs.openSync(element, "r+") | |
var data = fs.readFileSync(file, "utf8") |
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 gpiozero import Robot | |
from time import sleep | |
robot = Robot(left = (7, 8), right = (9, 10)) | |
while True: | |
robot.forward() | |
sleep(2) | |
robot.stop() | |
robot.right() | |
sleep(2) | |
robot.stop() |
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
def crown(length, height): | |
for i in range(0, height): | |
for j in range(0, length): | |
if i == 0: | |
print(" ", end = "") | |
elif i == height - 1: | |
print("-", end = "") | |
elif ((j < i or j > height - i) and | |
(j < height + i or | |
j >= length - i)) : |
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 pyjokes | |
import time | |
print ("10 geeky jokes to have you cracking up: \n") | |
time.sleep(1.5) | |
jokes = pyjokes.get_jokes(language='en', category='neutral') | |
for i in range(10): | |
print(i+1,':',jokes[i]) | |
time.sleep(2) |
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 forex_python.converter import CurrencyRates | |
import time | |
cr = CurrencyRates() | |
amount = int(input("Enter the amount you want to convert: ")) | |
time.sleep(1) | |
from_currency = input("Enter the currency code to be converted: ").upper() | |
time.sleep(1) | |
to_currency = input("Enter the currency code to convert to: ").upper() | |
time.sleep(1) |
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 tkinter import * | |
from langdetect import * | |
from iso639 import languages | |
root = Tk() | |
root.title("Language Detector") | |
root.geometry("400x480") | |
def language_detection(): | |
text = T.get("1.0", 'end-1c') | |
language_code = languages.get(alpha2=detect(text)) | |
l_d.config(text="Language Detected: "+language_code.name) |