What do you want to save?
Add Code snippet
New code examples
-
Python 2021-08-27 16:13:01
neural network hyperparameter tuning
# random search cross validation in neural network model from keras.models import Sequential from keras.layers import Dense, Dropout from keras.wrappers.scikit_learn import KerasClassifier def report(results, n_top=3): for i in range(1, n_top + 1): ... Add solution -
Java 2021-08-27 13:45:01
Mergesort parallelization using Spark
import random import time from pyspark import SparkContext def execute_merge_sort(generated_list): start_time = time.time() sorted_list = merge_sort(generated_list) elapsed = time.time() - start_time print('Simple merge sort: %f sec' % el... Add solution -
Python 2021-08-27 13:43:02
add python function on radius = 3.56 area = calcAreaCircle(radius) perimeter = calcPerimeterCircle(radius) print('Circle : area = {0:.2f}, perimeter = {1:.2f}'.format(area, perimeter))
radius = 3.56 area = calcAreaCircle(radius) perimeter = calcPerimeterCircle(radius) print('Circle : area = {0:.2f}, perimeter = {1:.2f}'.format(area, perimeter)) side = 9.23 area = calcAreaSquare(side) perimeter = calcPerimeterSquare(side) print... Add solution -
Python 2021-08-27 12:55:01
how to encrypt and decrypt strings python
from cryptography.fernet import Fernet def load_key(): """ Load the previously generated key """ return open("secret.key", "rb").read() def decrypt_message(encrypted_message): "&... Add solution -
Python 2021-08-27 12:35:02
how to use def in python
def myFunction(say): #you can add variables to the function print(say) myFunction("Hello") age = input("How old are you?") myFunction("You are {} years old!".format(age)) #this is what you get: Hello How old are you? &... Add solution -
TypeScript 2021-08-27 11:57:02
Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up.
price=[10,20,4,5,4,6,46,43,4,64,65,8,45,55,558,15,5,4,6,5,255,5] price.sort() price.reverse() max=price[0] sec_max=price[1] print(price) print(f"the max is {max}, runner up is {sec_max}") Add solution