What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-07 03:05:03
Consider the relation S defined on the set of courses C above where c1 S c2 if and only if
def relation_R(c1,c2): if c1==c2: return true if c1[0] == c2[0]: if c[1] < c[2]: return true return false def relation_S(c1,c2): if c1 == c2: return True if c1[0] == c2[0]: if c1[1] < c2[2]: return true elif c1[0]==c2[0]: if c1[3][0]==c2[3][0]: ret... Add solution -
Python 2021-09-05 21:26:01
discord.py commands.group
@bot.group() async def git(ctx): if ctx.invoked_subcommand is None: await ctx.send('Invalid git command passed...') @git.command() async def push(ctx, remote: str, branch: str): await ctx.send('Pushing to {} {}'.format(remote, branch)) Add solution -
Other 2021-09-05 20:28:01
react click outside class implementation
import React, { Component } from 'react'; import PropTypes from 'prop-types'; /** * Component that alerts if you click outside of it */ export default class OutsideAlerter extends Component { constructor(props) { super(props); this... Add solution -
Other 2021-09-05 10:55:03
def most_frequent(given_list): max_count = -1 max_item = None count = {} for i in given_list: if i not in count: count[i] = 1 else: count[i] += 1 if count[i] > max_count: max_count = count[i] max_item = i return max_item
def most_frequent(given_list): max_count = -1 max_item = None count = {} for i in given_list: if i not in count: count[i] = 1 else: count[i] += 1 if count[i] > max_count: max_c... Add solution -
Python 2021-09-05 07:38:04
python remove punctuation from text file
import string sentence = "Hey guys !, How are 'you' ?" no_punc_txt = "" for char in sentence: if char not in string.punctuation: no_punc_txt = no_punc_txt + char print(no_punc_txt); # Hey guys How are you #... Add solution -
Javascript 2021-09-05 03:26:01
if checkbox is checked
$( "SELECTOR" ).attr( "checked" ) // Returns ‘true’ if present on the element, returns undefined if not present $( "SELECTOR" ).prop( "checked" ) // Returns true if checked, false if unchecked. $( "... Add solution