Skip to content

Instantly share code, notes, and snippets.

View FloydanTheBeast's full-sized avatar
⚙️
Grinding

Shadi Abdelsalam FloydanTheBeast

⚙️
Grinding
View GitHub Profile
@FloydanTheBeast
FloydanTheBeast / IntegerInput.cs
Created November 4, 2019 11:03
Integer input with predicate as a parameter
/// <summary>
/// Метод для ввода целочисленного значения
/// </summary>
/// <param name="isCorrect">Предикат, проверяющий правильность ввода</param>
/// <returns>Введённое из консоли число</returns>
public static int IntInput(Func<int, bool> isCorrect = null, string msg = null)
{
if (msg != null)
{
Console.WriteLine(msg);
from nltk import sent_tokenize, word_tokenize
from string import punctuation
from collections import defaultdict
import operator
def count_one_symbol_words(word_list):
counter = 0
for word in word_list:
if len(word) == 1 and word not in punctuation:
counter += 1