blob_id
string
repo_name
string
path
string
length_bytes
int64
score
float64
int_score
int64
text
string
is_english
bool
104fac3bec6c7975673715d7a3d2594d6d8e9d63
AlphaCoderX/MyPythonRepo
/Assignment 1/RecipeConverter.py
1,157
4.125
4
#Programmer Raphael Heinen #Date 1/19/17 #Version 1.0 print "-- Original Recipe --" print "Enter the amount of flour (cups): ", flour = raw_input() print "Enter the amount of water (cups): ", water = raw_input() print "Enter the amount of salt (teaspoons): ", salt = raw_input() print "Enter the amount of yeast (teaspoo...
true
463fab4b59fd21609889666840b14b98e01a80bf
helloallentsai/leetcode-python
/1295. Find Numbers with Even Number of Digits.py
958
4.21875
4
# Given an array nums of integers, return how many of them contain an even number of digits. # Example 1: # Input: nums = [12,345,2,6,7896] # Output: 2 # Explanation: # 12 contains 2 digits (even number of digits). # 345 contains 3 digits (odd number of digits). # 2 contains 1 digit (odd number of digits). # 6 conta...
true
1934cd000cca0cbf14f5b286dbbf8c65fecc7f1f
seekindark/helloworld
/python/py-study/test-class-var.py
1,515
4.125
4
class A: # x = [] # 定义在这里,表示类变量, 被所有实例化的对象公共使用 # y = 0 def __init__(self): self.x = [] self.y = 0 pass def add(self): self.x.append('1') self.y+=1 a = A() a.add() print("第一次示例化 CLASS A:") print('a.x, a.y = ', a.x, ', ', a.y) #print('A.x, ...
false
6c0da654abdc01986b10d70f380f02b0f7800d29
seekindark/helloworld
/python/py-study/testlist.py
1,968
4.375
4
# # define a function to print the items of the list # def showlist(team): i = 0 for item in team: # end= "" will not generate '\n' automatically print("list[%d]=%s" % (i, item), end=" ") i += 1 print("\n-------------------") team = ['alice', 'bob', 'tom'] print...
true
8fb063a77d24fc0a4e30759ca867b24d4c448a56
sabbirDIU-222/Learb-Python-with-Sabbu
/loopExercize.py
1,483
4.46875
4
# for loop exersize in the systamatic way # so we first work with the list party = ['drinks','chicken','apple','snow','ice','bodka','rma','chess board'] for p in party[:4]: print(p) print(len(p)) print(sorted(p)) for n in "banana": print(n) # break statement to break the loop in ...
true
8722f4bb822695661283390262191645973fe50f
sabbirDIU-222/Learb-Python-with-Sabbu
/More Tuple.py
854
4.46875
4
# for singly making a tuple aTuple = ("sabbit",) # we need a comma after entering one elements print(aTuple) print(type(aTuple)) # <class 'tuple'> # but if we don't give any comma it will not be a tuple bTuple = ("samiwon akter") print(bTuple) print(type(bTuple)) # <class 'str'> # unpacking a tuple num...
false
0538dcce7066dd495345d9a8dadc9223d7d3afa4
sabbirDIU-222/Learb-Python-with-Sabbu
/SymmetricDifference.py
637
4.15625
4
''' so i have a challenge that can make a new list from two list make out what the difference supppose we have two list list1 = [1,2,3,4,5] list2 = [12,3,4] now in these two lists what the difference 5 is the different it;s like the intersaction ''' list1 = ['kalam','jabbar','bo...
false
7d20e78c33f560812eac4f0f420b3035bdc6b322
sabbirDIU-222/Learb-Python-with-Sabbu
/Unpacking Arguments.py
928
4.21875
4
# so what is unpacking ugument # i am surprised to know about the horriable things # and that is , what i learn about the arbetery argument \ # or can i call it paking and unpaking # so what i learn aboout variable argument \ ''' def _thisFunction(*args): sum = 0 for n in range(0,len(args)): ...
true
e143776f739ae3ded6226c494b5d8d13db2c17d6
sabbirDIU-222/Learb-Python-with-Sabbu
/calculatearea.py
744
4.21875
4
# this program represent that we are going to find some area # calculate the area of a triangle # take the import math print("calculate the area of triangle ") base = float(input("base of triangle : ")) height = float(input("height of triangle : ")) _calculateTriArea = 0.5 * base * height print(f"the ...
false
30ecabffb4a77fdd09838ca872a01b14f72a08c1
ylee0908/Algorithm.py
/panlindrome_linkedlist.py
1,955
4.125
4
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def print_list(self): cur_node = self.head while cur_node: print(cur_node.data) cur_node = cur_node.next def ...
false
e76737fb088ea69b73e34bf61037610d30e869d1
ccccclw/molecool
/molecool/measure.py
1,252
4.15625
4
""" This module is for functions """ import numpy as np def calculate_distance(rA, rB): """ Calculate the distance between two points. Parameters ---------- rA, rB : np.ndarray The coordinates of each point. Return ------ distance : float The distance between the t...
true
6433e495fd2d47ee50910d166821502eab388856
mdk7554/Python-Exercises
/MaxKenworthy_A2P4.py
2,537
4.25
4
''' Exercise: Create program that emulates a game of dice that incorporates betting and multiple turns. Include a functional account balance that is updated with appropriate winnings/losses. ''' import random #function to generate a value from dice roll def roll(): return int(random.randrange(1,7)) #function to ...
true
11a0db557909161e59c03ab75726f02e4275be5a
gammaseeker/Learning-Python
/old_repo/6.0001 Joey/sanity_check2.py
848
4.15625
4
annual_salary = 120000 portion_saved = .1 total_cost = 1000000 monthly_salary = (annual_salary / 12.0) portion_down_payment = 0.25 * total_cost current_savings = 0 returns = (current_savings * 0.4) / 12 overall_savings = returns + (portion_saved * monthly_salary) months = 0 # Want to exit the loop wh...
true
c5f3dcab578ef708da59fc2be131ef86cf6660e1
gammaseeker/Learning-Python
/old_repo/6.0001 Joey/sanity_check.py
623
4.15625
4
annual_salary = 120000 portion_saved = .1 total_cost = 1000000.0 monthly_salary = (annual_salary / 12.0) portion_down_payment = 0.25 * total_cost current_savings = 0 returns = (current_savings * 0.04) / 12 overall_savings = returns + (portion_saved * monthly_salary) months = 0 # Want to exit the lo...
true
25a56640f12bd79448b0b5ba4de024441a00eb0d
alessandrogums/Desafios_Python_funcoes
/Exercicio.6_listaPyBr.py
1,833
4.1875
4
# Faça um programa que converta da notação de 24 horas para a notação de 12 horas. Por exemplo, o programa deve converter 14:25 em 2:25 P.M. # A entrada é dada em dois inteiros. Deve haver pelo menos duas funções: uma para fazer a conversão e uma para a saída. # Registre a informação A.M./P.M. como um valor ‘A’ para ...
false
e0a5c95ec996fd314a829b8f41043a0f3aaa9d4c
JanDimarucut/cp1404practicals
/prac_06/car_simulator.py
1,397
4.125
4
from prac_06.car import Car MENU = "Menu:\nd) drive\nr) refuel\nq) quit" def main(): print("Let's drive!") name = input("Enter your car name: ") my_car = Car(name, 100) print(my_car) print(MENU) menu_choice = input(">>>").lower() while menu_choice != "q": if menu_choice == "d": ...
true
210105f313227d23381e8ce2e0511df1ffec2637
JanDimarucut/cp1404practicals
/prac_04/list_exercises.py
2,647
4.40625
4
# 1 numbers = [] for i in range(5): number = int(input("Number: ")) numbers.append(number) # print("The first number is: ", numbers[0]) # print("The last number is: ", numbers[-1]) # print("The smallest number is: ", min(numbers)) # print("The largest number is: ", max(numbers)) # print("The average of the nu...
true
8110f3a49b6abc0b0d9d622ad5a47af30d447246
limjeongmin/p2_201611101
/w5Main_8(2).py
462
4.3125
4
def BMI(): height=input("input user height (m):") weight=input("input user weight (kg):") BMI=weight/(height*height) print BMI if BMI<=18.5: res='Underweight' elif 18.5<BMI<=23: res='nomarlweight' elif 23<BMI<=25: res='ove weight' elif 25<BMI<=30: ...
false
a00f702483bab4e505f2c2cb7b7bc790d01beeeb
Zach-Wibbenmeyer/cs108
/lab05/spirograph.py
2,909
4.125
4
'''Using Python to draw a spirograph March 5, 2015 Lab05 Exercise 2 Zach Wibbenmeyer (zdw3)''' #Gains access to the turtle module import turtle #Gains access to the math module import math #Prompts the user to enter a choice if they would like to draw or not choice = str(input('Would you like to draw a spirograph? (...
true
703a6f099c981601b87743d254d6b6661626fa6f
mronowska/python_code_me
/zadania_domowe/zadDom3.py
945
4.28125
4
men_name = input("Male name: ") feature_positive = input("Positive feature of this man: ") feature_negative = input("Negative feature of this man: ") day_of_the_week = input("Day of the week: ") place = input("Place: ") animal = input("Animal: ") print( f"There was a man called {men_name}. In one hand he was {feat...
true
8df97a9d1609a30896b0a3342a44b11cc7fcce90
Mannuel25/py-projects
/all-python-codes/e-mail-scrapper/email.py
502
4.25
4
# file input for users fname = input('Enter file name: ') # if the enter key is pressed 'emailfile.txt' is the file automatically if (len(fname) < 1): fname = 'emailfile.txt' #file handle fh = open(fname) # a loop that prints out the email for line in fh: # parsing through if not line.startswith('From ...
true
f1e0b7caafb0e93735eeb2b8fda8ba152076607d
Mannuel25/py-projects
/all-python-codes/password-generator/password-generator-2/generate_password.py
1,523
4.34375
4
import secrets, string def password_generator(): """ A program that generates a secure random password : return: None """ try: # get the length of alphabets to be present in password length_of_alphabets = int(input('\nEnter the length of alphabets (upper and lower case inclusive): '...
true
eb7d6522bdc0ed9b1a9a6533d84528f0bb27f78e
solankeganesh777/Python-Basics-for-data-science-project
/Matplotlib/Plotting.py
458
4.15625
4
# Matplotlib Plotting #Plotting X and Y points x=np.array([1,4,5,7]) y=np.array([5,3,9,5]) plt.plot(x,y) plt.show() print("\n") #Plotting without line x=np.array([1,4,5,7]) y=np.array([5,3,9,5]) plt.plot(x,y,'o') plt.show() print("\n") # Multiple points x=np.array([1,6,4,2,5,7]) y=np.array([5,3,8,9,3,5]) plt.plot(x,...
false
f38dcb8559ab8e18e3b5215d549e9193427061cc
solankeganesh777/Python-Basics-for-data-science-project
/Python basics/Iterator.py
666
4.21875
4
#Python Iterators list=[1,2,3,4,5,6,7,8] myit=iter(list) print(next(myit)) print(next(myit)) print(type(myit)) print("\n") name="Ganesh" myit=iter(name) print(next(myit)) print(next(myit)) print(type(next(myit))) print(next(myit)) print(next(myit)) print(next(myit)) print("\n") #Creation of iterator class MyNumbers...
false
8abed6121ee7847b3d076fa7c555db089ec3f483
wajdm/ICS3UR-5-05-Python
/addressing_mails.py
1,866
4.46875
4
# !/usr/bin/env python3 # Created by: Wajd Mariam # Created on: December 2019 # This program formats the mailing address using given input. def format_address(first_name, last_name, street_add, city, province, postal_code, apt_number=None): # returns formatted mailing address if apt_numbe...
true
ac566079a1f0b1c8b05a921253df65872f4d2201
tryingtokeepup/Sorting
/src/iterative_sorting/iterative_sorting.py
1,387
4.34375
4
# TO-DO: Complete the selection_sort() function below def swapping_helper(index_a, index_b, arr): # cool_dude = array temp = arr[index_a] arr[index_a] = arr[index_b] arr[index_b] = temp return arr def selection_sort(arr): # loop through n-1 elements for i in range(0, len(arr) - 1): ...
true
9a718e4a71ef9f2a19f9decc472d6fba57a5cb51
czwartaoslpoj/book-review-project
/templates/house_hunting.py
736
4.1875
4
//calculating how many months I need to save the money fo portion_down_payment total_cost = int(input("The cost of your dream house: ")) portion_down_payment = total_cost/4 current_savings = 0 annual_salary= int(input("Your annual salary: ")) portion_saved = float(input("Portion of your salary to save as a decim...
true
e1a42bb8d1b00666fe1a9d2022d116fc879630eb
markellisdev/bangazon-orientationExercises1-6
/bangazon.py
2,605
4.15625
4
class Department(object): """Parent class for all departments Methods: __init__, get_name, get_supervisor """ def __init__(self, name, supervisor, employee_count): self.name = name self.supervisor = supervisor self.size = employee_count def get_name(self): """Retur...
true
55f4e852fd8e90f8e3ab507f22a881a4a1e63181
zhufangxin/learn-python3
/Fractal_tree/fractal_tree.py
825
4.28125
4
""" 递归 绘制分形树 """ import turtle def draw_branch(branch_length): """ 绘制分形树 """ if branch_length > 5: #  绘制右侧树枝 turtle.forward(branch_length) print('向前', branch_length) turtle.right(20) print('向右20度') draw_branch(branch_length - 15) ...
false
9eea9265e1ace539b7498d06a98811dc189c3578
strawwhat/diary
/programming-three/three134.py
2,269
4.125
4
#!/usr/bin/python # *-*coding:utf-8 *-* "示例3-9 page134 redirect.py 重定向流到python对象" """ file-like objects that save standard output in a string and provide standard input text a string ; redirect runs a passed-in function with its output and input streams reset to these file-like class objects 类似文件的对象,用于在字符串中保存标准输出并提供...
false
24f6feeda30f66fddf433d9d4c0cd388b6509763
MrDeshaies/NOT-projecteuler.net
/euler_042.py
1,597
4.125
4
# The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); # so the first ten triangle numbers are: # # 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... # # By converting each letter in a word to a number corresponding to its alphabetical position and # adding these values we form a word value. For examp...
true
542759df80baa3bdc951931364e72aea52226305
amitkumar-panchal/ChQuestiions
/python/q01/Contiguous.py
1,558
4.28125
4
""" Fiels: _items is a list of items _size is number of items that can be stored """ ## Contiguous(S) produces contiguous memory of size s ## and initializes all entries to None. ## Requires: s is positive class Contiguous: def __init__(self, s): self._items = [] self._size = s; for ...
true
164e6ece6af8f27d2f6154414be81e602fc2c53b
Anushadsilva/python_practice
/List/list.pg5.py
489
4.21875
4
'''Write a Python program to extract specified size of strings from a give list of string values. Go to the editor Original list: ['Python', 'list', 'exercises', 'practice', 'solution'] length of the string to extract: 8 ''' #Solution: if __name__ == '__main__': list1 = ['Python', 'list', 'exercises', 'practice', 's...
true
e6e3fecae85caf717dd594e94096a717e9cd16b4
Anushadsilva/python_practice
/dictionary/dict_py6.py
575
4.125
4
'''Write a Python program to count the frequency in a given dictionary. Original Dictionary: {'V': 10, 'VI': 10, 'VII': 40, 'VIII': 20, 'IX': 70, 'X': 80, 'XI': 40, 'XII': 20} Count the frequency of the said dictionary: Counter({10: 2, 40: 2, 20: 2, 70: 1, 80: 1})''' #Solution if __name__ == '__main__': dict1 = ...
false
d68786a9942542808767b47b11919d0f7f7eaa6a
Anushadsilva/python_practice
/Functions/func_pg3.py
305
4.28125
4
#Write a Python function to find the Max of three numbers def mx(x,y,z): return max(x,y,z) if __name__ == '__main__': a = int(input("Enter the first number")) b = int(input("Enter the second number")) c =int(input("Enter the third number")) print("max of the given numbers is: ", mx(a,b,c))
true
579d6046604626afd901e8885bcce6de1a8fb09c
SinghReena/TeachPython3
/SayNamesMultipleTimes.py
591
4.21875
4
# SayNamesMultipleTimes.py - lets everybody print their name on the screen # Ask the user for their name name = input("Can I know your name please: ") # Keep printing names until we want to quit while name != "": # Print their name 35 times for x in range(35): # Print their name followed by a spa...
true
ac96cf0e2ab8e77a576743b00c938e0d259aa089
TanmoyX/CodeStore-Cracking_The_Coding_Interview
/Chap2/2.1 - RemoveDuplicates/n2-sol.py
936
4.125
4
class Node: def __init__(self, val): self.data = val self.next = None def printLL(node): while node != None: print(node.data) node = node.next def insertNode(node, val): if node == None: return None while node.next != None: node = node.next node.next...
true
dcc1cf9a1a3e14da5f1e39d9f11447d0354b39d9
Visorgood/CodeBasics
/Python/MergeSort.py
966
4.1875
4
def mergesort(array): if len(array) == 1: return array else: middle = len(array) / 2 half1 = mergesort(array[:middle]) half2 = mergesort(array[middle:]) mergedarray = merge(half1, half2) return mergedarray def merge(half1, half2): mergedarray = [] lenhal...
false
7f8be46a01d986de37906424a7c6e7e186ca30c3
Shivani3012/PythonPrograms
/conditional ass/ques33.py
484
4.375
4
#Write a Python program to convert month name to a number of days. print("Enter the list of the month names:") lname=[] for i in range(0,12): b=input() lname.append(b) #print(lname) m=input("Enter the month name:") ind=lname.index(m) #print(ind) if ind==0 or ind==2 or ind==4 or ind==6 or ind==7 or ind==9 or ind...
true
21d89fe0a3fbf5d59124847acd307845da9205ce
Shivani3012/PythonPrograms
/guessing a number.py
876
4.15625
4
print(" Welcome to the Guessing a Number Game ") print("You have to guess a number if the number matches the random number") print("you win the game else you will only get three chances") name=input("Enter the user name") import random for i in range (1,4): print("Chance",i) r=random.randint(10,50)...
true
53ca55ed41ad6b133f43f1951a52320980eed50d
Shivani3012/PythonPrograms
/conditional ass/ques6.py
419
4.15625
4
#Write a Python program to count the number of even and odd numbers from a series of numbers. a=int(input("Enter the number of elements in the list")) print("Enter the list") l=[] countev=0 countodd=0 for i in range(a): b=int(input()) l.append(b) for i in range(a): if l[i]%2==0: countev+=1 else:...
true
52a686724c000189abcae44a27fc2e0eda9f4b70
Shivani3012/PythonPrograms
/conditional ass/ques35.py
212
4.40625
4
#Write a Python program to check a string represent an integer or not. s=input("Enter the string") a=s.isdigit() #print(a) if a==True: print("This is an integer.") else: print("This is not an integer.")
true
bd87a4ee20fdf0e51fad300f66b818f95a5d76dc
bend-is/pystudy
/basics/lesson_5/task_3.py
879
4.21875
4
""" Создать текстовый файл (не программно), построчно записать фамилии сотрудников и величину их окладов. Определить, кто из сотрудников имеет оклад менее 20 тыс., вывести фамилии этих сотрудников. Выполнить подсчет средней величины дохода сотрудников. """ MIN_SALARY = 20000 with open('task_3.txt') as f: total_sa...
false
86c212bb843d178fc0744f9d0b0db790f8d8ba47
bend-is/pystudy
/basics/lesson_3/task_4.py
1,183
4.21875
4
""" Программа принимает действительное положительное число x и целое отрицательное число y. Необходимо выполнить возведение числа x в степень y. Задание необходимо реализовать в виде функции my_func(x, y). При решении задания необходимо обойтись без встроенной функции возведения числа в степень. """ from typing import ...
false
16c02f1a57a85d4e45879e71444e013a6092c395
bend-is/pystudy
/basics/lesson_1/task_5.py
1,388
4.15625
4
""" Запросите у пользователя значения выручки и издержек фирмы. Определите, с каким финансовым результатом работает фирма (прибыль — выручка больше издержек, или убыток — издержки больше выручки). Выведите соответствующее сообщение. Если фирма отработала с прибылью, вычислите рентабельность выручки (соотношение прибыли...
false
4112f792af4b4e1cd696891ebaa81dcd6868a4c1
KaanSerin/python_side_projects
/rock_paper_scissors_game.py
2,879
4.28125
4
import random def welcomeMessage(): print("Welcome to my very basic rock, paper, scissors game!") print('You can play as long as you want.') print('Whenever you want to quit, just enter -1 and the game will end immediately.') #Implementing the rules of rock paper scissors with if-else blocks d...
true
d43a964b2eddddbfd01ad71ee356b7711f7945fd
s-ajensen/2017-18-Semester
/knockKnock/blackbelt.py
1,857
4.21875
4
# Samuel Jensen, Knock Knock Joke Blackbelt, 9/28/2017 # Checks user input, gets frustrated when user doesn't go with the joke, unnecessary recursion # Get user's name name = input("Hi what's your name?") # Ask user if they want to hear a joke hearJoke = input("Nice to meet you " + name + ", would you like to hear a ...
true
f7b353f903f773892c834561b89e06b732cb61ca
x223/cs11-student-work-ibrahim-kamagate
/april11guidedpractice.py
861
4.25
4
# what does this function return ? This prints the x*2 which is 7*2 def print_only(x): y = x * 2 print y # how is this one different ? This does the same thing as the print function but you dont see it def return_only(x): y = x * 2 return y # let's try to use our 2 functions print "running print_only ..."...
true
90e995d7a410da9d546f1c3a2f687c9e12c74995
prasanth-vinnakota/python-gvp
/generator-fibonacci.py
358
4.125
4
def fibonacci(n): a = 0 b = 1 for i in range(n): yield a a, b = b, a + b size = None try: size = int(input("Enter size of fibonacci series: ")) if size == 0: raise ValueError except ValueError: print("input must be a number and greater than 0") exit(0) for j in f...
true
3c86b4be1943399afdee8e86a7e9d160b51ba1d2
ieee-saocarlos/exercicios-ia
/Vitorstraggiotti/Lista 3/ex_1_lista3_vitor.py
298
4.125
4
print "Este programa ira mostrar se uma palavra e um palindromo" palavra = input("digite uma palavra entre aspas: ") palavra_invertida = palavra[::-1] if(palavra_invertida == palavra): print "\n\nA palavra digitada e um palindromo" else: print "\n\nA palavra digitada nao e um palindromo"
false
e9eea0d01e357b5e936f26e8b114d7657ba56b5f
luiz-ricardo-dev/Python
/aula2.py
796
4.15625
4
#Operadores Aritiméticos a = int(input('Entre com o primeiro valor: ')) b = int(input('Entre com o segundo valor: ')) soma = a + b subtracao = a - b multiplicacao = a * b divisao = a / b resto = a % b resultado =('Soma: {soma} ' '\nSubtração: {subtracao} ' '\nMultiplicação: {multiplicacao} ' '\nDivisã...
false
2cfe7c91405ec313dfed83e864bf6e18f5d8e276
jing1988a/python_fb
/900plus/FractionAdditionandSubtraction592.py
2,718
4.1875
4
# Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irreducible fraction. If your final result is an integer, say 2, you need to change it to the format of fraction that has denominator 1. So in this cas...
true
1e4e214385a54a8e225977e90172fe154dd2300a
jing1988a/python_fb
/lintcode_lyft/ReverseInteger413.py
558
4.125
4
# Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer). # # Example # Given x = 123, return 321 # # Given x = -123, return -321 class Solution: """ @param n: the integer to be reversed @return: the reversed integer """ def reverseInteger(self, n): ...
true
f8aef6ac6c5f8838b8fed96f3f36437c6560a423
Almr1209/idk
/ex32.py
1,001
4.59375
5
the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a loop for number in the_count: print(f"This is count {number}") # same as above, basically it's using the same format but different var...
true
a6ec7fbff14b620d8f2f7d227ac5818d82032892
Gustana/py-challenges
/learn/triangle.py
355
4.3125
4
height = int(input("Insert height :")) #5 # * # * * # * * * # * * * * # * * * * * # * * * * * * limit = 1 while (limit<=height) : star = limit space = height while (space >= limit) : print(" ", end="") space-=1 while (star >= 1) : print("* ", end="") s...
false
6ca93d9a5fd4ab3654186883a427d7aa0bc02515
Valery-Bolshakov/learning
/theory/lesson_6.py
1,159
4.15625
4
print('Переменные\n') a = 1 # создали переменную х и присвоили ей значение 1 y = 3 # int u = 3.5 # float my_var1 = 15 # определить тип переменной: print('задали перменную класса - ', type(y)) print('задали перменную класса - ', type(u)) # Переменные являются регистрозависимыми: x = 13 X = 14 print(x, X) ''' Псе...
false
e5db03cd5cde605a6fda0837ae334bfb247d231f
sarahoeri/Giraffe
/window.py
1,229
4.15625
4
# Tuples...don't change like in lists even_numbers = (2, 4, 6, 8, 10, 12) print(even_numbers[5]) # Functions def sayhi(name, age) : print("Hello " + name + " you are " + age) sayhi("Nancy", "25") sayhi("Christine", "27") # Return Statement def square(num) : return num*num print(square(8)) def cube(num) : ...
true
9391c201f98ce42de5efc3c74cf6a32887901013
hyperskill/hs-test
/src/test/java/projects/python/coffee_machine/stage3/machine/coffee_machine.py
1,127
4.25
4
# Write your code here water_amount = int(input('Write how many ml of water the coffee machine has:')) milk_amount = int(input('Write how many ml of milk the coffee machine has:')) coffee_amount = int(input('Write how many grams of coffee beans the coffee machine has:')) N = int(water_amount / 200) if N > milk_amount /...
true
78d06b6a9fb261085da55a1bdfbdc68443e61ecf
codegauravg/Python-Practice
/Hackerrank Problems/Prog2-If-Else.py
595
4.34375
4
# -*- coding: utf-8 -*- #!/usr/bin/python """ Task Given an integer, n, perform the following conditional actions: If n is odd, print Weird If n is even and in the inclusive range of 2 to 5, print Not Weird If n is even and in the inclusive range of 6 to 20, print Weird If n is even and greater than 20...
false
6886fb7cda4200f52e9021cba4b2989aa73d3b62
mybatete/Python
/Prime Number/prime.py
264
4.125
4
prime=True num = input("Enter a Number: ") if num <1: print "Enter a Number Greater Than 1!!!" exit() for k in xrange(2,num): if num % k == 0: prime = False break if prime == True: print num,"is a Prime Number" else: print num,"is NOT a Prime Number"
false
8cd722978b4902fd1f5e803d37358ac481741a54
mybatete/Python
/seqBinSearch.py
1,873
4.25
4
""" Program: seqBinSearch.py Author : Charles Addo-Quaye E-mail : caaddoquaye@lcsc.edu Date : 01/31/2018 Description: This program implements demo for both sequential and binary search algorithms. The program generates a random list of integers and provides a menu for searching for numbers in the list. Input v...
true
97cbad6efeed92d06082f371966262e15d6cdfe5
krissmile31/documents
/Term 1/SE/PycharmProjects/pythonProject/venv/TemperatureConverter.py
233
4.40625
4
print("Celsius to Fahrenheit temperature Converter!\n") Celsius = float(input("Enter the temperature in Celsius: " )) convert = (9/5) * Celsius + 32 print("\nCelsius: ", Celsius, "℃") print(" Fahrenheit: " , convert, "℃")
false
dff114f7caa3b803d85a634807ae4e38aa70a4e0
krissmile31/documents
/Term 1/SE/PycharmProjects/pythonProject/Tut2/Most Frequent Character.py
263
4.28125
4
from collections import Counter #ask user input a string stringCount = input("Enter a string: ") #count char appearing most in that string count = Counter(stringCount).most_common(1) print("Character that appears most frequently in the string: " ) print(count)
true
2ac298765900d155eab1e26560908a7efa884d45
IceMortyGod/icemortoos
/IceMorty Pro Calculator.py
1,167
4.1875
4
print("Welcome To Sub To Icemorty Facking Calculator:)") x = int(input('Enter the first number pls: ')) y = int(input('Enter the second number: ')) yes = ("Good Job Facker :)") no = ("fuck of facker 👿") def add(x, y): print(x + y) def subtract(x, y): print(x - y) def multiply(x, y): print(x * y) d...
false
8dfcd3b7339f271409fa64ae63b4357c8692e990
adinimbarte/codewayy_python_series
/Python_Task6/Q.4/Q.4.py
283
4.15625
4
# taking string input string = input("Enter the string from which you want to count number of 'at': ") # counting occurence of "at" and printing count=string.count("at")+ string.count("At")+ string.count("At") + string.count("AT") print("'at'occured %d times in string." % count )
true
d5d37cee9cdfcc9d9e949ed99da5dd70d723b536
SergiBaucells/DAM_MP10_2017-18
/Tasca_1_Python/src/exercici_5_python.py
417
4.125
4
numero1 = int(input("Número 1: ")) numero2 = int(input("Número 2: ")) numero3 = int(input("Número 3: ")) if numero1 < numero2 and numero1 < numero3: mcd = numero1 elif numero2 < numero1 and numero2 < numero3: mcd = numero2 else: mcd = numero3 while True: if numero1 % mcd == 0 and numero2 % mcd == 0 an...
false
c94fe10616b30c1291d5675772810fc0374fbc69
KeithWilliamsGMIT/Emerging-Technologies-Python-Fundamentals
/03-fizzbuzz.py
506
4.34375
4
# Author: Keith Williams # Date: 21/09/2017 # This script iterates between the numbers 1 and 100. # For each iteration there is a condition for each of the following: # 1) For numbers which are multiples of both three and five print "FizzBuzz". # 2) For multiples of three print "Fizz". # 3) For multiples of five print...
true
a406961c86682d5d15c0b6eaa25a187a33a8ae59
scoffers473/python
/uneven_letters.py
564
4.28125
4
#!/usr/bin/python3 """ This takes an input word and prints out a count of uneven letters for example in aabbc we have one uneven letter (c). In hello we have 3 (hme and o) """ import sys from collections import Counter def solution (S): removal=0 counter = Counter(S) for letters in S: if count...
true
680528fefc54b25668e4e7fdb1ebc2cfc752f1ff
scoffers473/python
/days_offset.py
1,197
4.25
4
#!/usr/bin/python3 """ This take an input number and works out the offset day based on this number Days are Mon:1 Tue:2 Wed:3 Thu:4 Fri:5 Sat:6 Sun:7 So if i passwd an offset of 7 this would be a Sunday, a 5 a Friday, a 13 a Saturday, etc """ import sys def solu...
true
0e55bc414b576a4a6962eaac939dd1709fcb04de
ksu-is/Congrats
/test_examples.py
269
4.125
4
# Python code to pick a random # word from a text file import random # Open the file in read mode with open("MyFile.txt", "r") as file: allText = file.read() words = list(map(str, allText.split())) # print random string print(random.choice(words))
true
3b4d4944bfe4a170225e0d213f327c89d890905d
lttviet/py
/bitwise/count_bits.py
337
4.15625
4
def count_bits(x: int) -> int: """Returns the number of bits that are 1. """ num_bit: int = 0 while x: # if odd, right most bit is 1 num_bit += x & 1 # shift to the right 1 bit x >>= 1 return num_bit if __name__ == '__main__': for i in (1, 2, 11): print(...
true
b81c76ba7cc637017c0432b6d9b0e527cd624fd3
tvanrijsselt/file-renamer
/main.py
1,058
4.15625
4
"""This main module calls the helper functions in the main-function, such that the right files in the right folder are changed.""" import os from helperfunctions import ask_input_for_path, ask_input_base_filename, files_ending_with_chars def main(): """Main function to call the helper functions and rena...
true
caedf25abc2fcbb1677d8743b9f50e254447bdd9
ahathe/some-a-small-project
/MyPython/test/StrBecome.py
320
4.15625
4
#!/usr/bin/env python 'make string become largest to smallest orade! ' num = list(raw_input("plaese input number!thank you!:")) choice = raw_input("input you choice!,one or two:") one = 'one' two = 'two' if choice == one: num.sort() print num elif choice == two: num.sort() for x,i in enumerate(num): print x,i
true
f24817dc2ad44edbe7a094542da901122c7b941c
ahathe/some-a-small-project
/MyPython/test/Count.py
229
4.3125
4
#!/usr/bin/env python def Count(count): if ' ' in count: count = count.split(' ') lisT = ['+','-','*','/','%','**'] if count[1] in lisT: Input = raw_input("input you want to count number and operator!:") Count(Input)
false
950c8785a6fe4cec2e491a1e1ca90a1651cae86d
ahathe/some-a-small-project
/MyPython/test/NumTest.py
1,626
4.25
4
#!/usr/bin/env python 'is input number to count mean and total' empty = [] def Input(): while True: num = raw_input("input you number to count mean!,input 'q' is going to quit!:") if num == ('q' or 'Q'): print 'rechoice input type,input or to count or remove or view!' Choice() else: try: number ...
true
1298ec09dc5cf5bbbe9ad19dd9a691e60e384b2c
JaclynStanaway/PHYS19a
/tutorial/lesson00/numpy-histograms.py
2,352
4.53125
5
""" Author: Todd Zenger, Brandeis University This program gives a first look at Numpy and we plot our first plot. """ # First, we need to tell Python to bring in numpy and matplotlib import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm # np and plt are the standard shortcut names we give it...
true
ba522adf755c38008a07ac70acb9effcc2dafe1e
sonushakya9717/Hyperverge__learnings
/dsa_step_10/power_of_number.py
238
4.15625
4
def power_of_number(n,x): if x==0: return 1 elif x==1: return n else: return n*power_of_number(n,x-1) n=int(input("enter the number")) x=int(input("enter the degree of no.")) print(power_of_number(n,x))
true
b692121aa036155e4db1b52d93d8fcf4d879636d
sug5806/TIL
/Python/algorithm/fibonacci/fibo_recur.py
449
4.125
4
def fibo_recursion(n): # base case if n<= 1: return 0 elif n==2: return 1 return fibo_recursion(n-2) + fibo_recursion(n-1) # 꼬리 재귀 --> while문으로 치환가능 def fibo_iteration(n): a = 0 b = 1 for _ in range(n-1): a, b = b, a+b return a if __name__=="__main__": ...
false
bb596882dd9fdf844b7996063ba7c672eb7f908a
ipsorus/lesson_2
/string_challenges.py
2,148
4.125
4
# Вывести последнюю букву в слове word = 'Архангельск' def last_letter(word): print(f'Последнняя буква в слове {word}: {word[-1]}') #last_letter(word) # Вывести количество букв "а" в слове word = 'Архангельск' def count_letters(word): letters = [] res = 0 letters = list(word) for letter in lette...
false
c0ce351076e780f0e59de674076758d093d7a362
1181888200/python-demo
/day3/10.py
1,131
4.28125
4
# 使用枚举类 # 更好的方法是为这样的枚举类型定义一个class类型,然后,每个常量都是class的一个唯一实例。Python提供了Enum类来实现这个功能: from enum import Enum Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')) # value属性则是自动赋给成员的int常量,默认从1开始计数。 for name , member in Month.__members__.items()...
false
dffdaf2533949385d9f615e4f4f5d8883486ab0b
ulyvodka93/paradigmas
/.gitignore/Adivina_Numero.py
1,809
4.15625
4
# Ulises Thompson python3 import msvcrt import random MENSAJE1 = "El rango de numero a adivinar va desde el 1 hasta el?... " MENSAJE2 = "Ingresa cuántas oportunidades habrá para adivinar el numero... " MENSAJE3 = "Cuál es el número?... " def pedirNumero(mensaje): """Retorna un numero ingresado po...
false
b732cda25aed23b3a2f629b89bccf286cf16c62c
mrvrbabu/MyPycode
/Python Developer Bootcamp/Section5-Python_Loops/1.for_loops_pt-1.py
472
4.4375
4
# ----------------------------------------------------------------------- # # --------------- ** For Loops ** -------------------------- # # Example 1 - DRY - Do not repeat yourself # n = 3 # for (i=0, i<=n,): # print(i) # i += 1 for x in range(10): print(x + 1) print("\n") for number in range(5): pri...
true
24a8c11de8abacaf180b9e99452ddf3e7adc17d6
mrvrbabu/MyPycode
/Python Developer Bootcamp/Section4-Python_Logic-Control_Flow/21.Conditional_statements.py
621
4.46875
4
# ----------------------------------------------------------------------- # # --------------- ** Control Statements ** ---------------------------- # """ if (boolean expression): execute the statements """ # ******************** Example Check for a single condition ******************* temperature = int(input(...
true
d0d29d933e69c997308480233cd114b6e10e188d
mrvrbabu/MyPycode
/Python Developer Bootcamp/Section5-Python_Loops/4.iterables.py
342
4.125
4
# ----------------------------------------------------------------------- # # --------------- ** Iterables ** -------------------------------------- # # *** Example 1 print(type(range(4))) for char in "Welcome Home": print(char) # *** Example 2 for somethin in ["Coffee", "Play with the cat", "Walk the dog"]...
true
7a3d476958d7a43f3545000557bd7c66990e2ab6
faustfu/hello_python
/def01.py
1,281
4.5
4
# 1. Use "def" statement with function name, parameters and indented statements to declare a function. # 2. Use "return" statement with data to return something from the function. # 3. If there is no "return" statement, the function will return "None". # 4. All parameters are references. # 5. Parameters could be assign...
true
e240fabceddd8c71f1a81d400582a996bbd0ac07
avbpk1/learning_python
/circle_area.py
251
4.4375
4
# Program to accept radius and calculate area and circumference radius = float(input("Please Enter Radius:")) pi = 22/7 area = pi * radius**2 circumference = pi * 2 * radius print(f"Area is : {area}") print(f"Circumference is : {circumference}")
true
2c95c3f1109bd296b05896f637a61c155f2ef6d8
avbpk1/learning_python
/assignments.py
476
4.125
4
# This is assignment 1 # Program to take input from user until 0 is entered and print average. Negative input to be ignored total = 0 cnt = 0 while True: num = int(input("Please enter a number (Entering Zero will terminate) : ")) if num == 0: break elif num < 0: continue else: ...
true
9f1190f69f2799fd18d2e86845f794643761d4c2
avbpk1/learning_python
/20May_ass4.py
568
4.1875
4
# -- ass4 -- use map to extract all alphabets from each string in a list. Use map and a function def ext_alpha(word_str): new_word = '' for c in word_str: if c.isalpha(): new_word += c return new_word words = ['Ab12c','x12y2','sdfds33&'] for word in words: alpha_extract =...
true
43aa1410040d47341dab6e09813c0820f38d3f97
LalithaNarasimha/Homework2
/Solution2.py
1,062
4.21875
4
# Code that compute the squares and cubes for numbers from 0 to 5, # each cell occupies 20 spaces and right-aligned numbers = [ 0, 1, 2, 3, 4, 5] place_width = 20 header1 = 'Number' header2 = 'Square' header3 = 'Cube' print('\nSolution 1\n') print(f' {header1: >{place_width}} {header2: >{place_width}} {header3: >{pl...
true
ef47c071219b5964290c6802f8006a639abf1955
amylearnscode/CISP300
/Lab 8-5.py
2,270
4.1875
4
#Amy Gonzales #March 21, 2019 #Lab 8-5 #This program uses while loops for input validation and calculates #cell phone minute usage def main(): endProgram = "no" minutesAllowed = 0 minutesUsed = 0 totalDue = 0 minutesOver = 0 while endProgram=="no": ...
true
97b54f212f883ae8625888c5c3fedebdd761caa9
ShizhongLi/Data-Analysis
/investigate texts and calls/Task1.py
988
4.1875
4
""" 下面的文件将会从csv文件中读取读取短信与电话记录, 你将在以后的课程中了解更多有关读取文件的知识。 """ import csv with open('texts.csv', 'r') as f: reader = csv.reader(f) texts = list(reader) with open('calls.csv', 'r') as f: reader = csv.reader(f) calls = list(reader) """ 任务1: 短信和通话记录中一共有多少电话号码?每个号码只统计一次。 输出信息: "There are <count> different te...
false
82fc95d5d86f08c337f3823f0bd147c142f8c69e
floydnunez/Project_Euler
/problem_004.py
852
4.21875
4
""" A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. """ import math def check_palindrome(number): is_palindrome = True str_num = str(number) size...
true
9b6ed13e70dcb0706ea37b9c4d36b8e838d7965a
swaroopsaikalagatla/Python
/python5.py
267
4.125
4
def maximum(a,b,c):#function list=[a,b,c]#statement 1 return max(list)#statement 2 x=int(input("Enter the first number : ")) y=int(input("Enter the second number :")) z=int(input("Enter the third number :")) print("biggest number is :",maximum(x,y,z))
true
acdda0fa4bceeaf72b4b94836f606591b7141a6c
joook1710-cmis/joook1710-cmis-cs2
/assignment1.py
2,319
4.3125
4
#Created a variable and defined my name. myName = "Joo Ok Kim" print myName #Created a variable and defined my age. myAge = 16.4 print myAge #Created a variable and defined my height. myHeight = 1.65 print myHeight #Created a variable and defined the length of a sqaure. lengthOfSquare = 4 print lengthOfSquare #Cre...
true
1362a39f7084df60f86894c00c920958a6bc5ad1
indykiss/DataStructures-Algos
/Leetcode/Python Easies/Replace_digits_w_chars.py
532
4.1875
4
# Replace All Digits with Characters # Input: s = "a1c1e1" # Output: "abcdef" # Explanation: The digits are replaced as follows: # - s[1] -> shift('a',1) = 'b' # - s[3] -> shift('c',1) = 'd' # - s[5] -> shift('e',1) = 'f' class Solution: def replaceDigits(self, s: str) -> str: res = '' f...
false
95e1b9576d1227e9bbe48ad5045c65f55605fb8e
indykiss/DataStructures-Algos
/Leetcode/Python Easies/Anagram_mappings.py
878
4.15625
4
# Find Anagram Mappings # You are given two integer arrays nums1 and nums2 where nums2 is # an anagram of nums1. Both arrays may contain duplicates. # Return an index mapping array mapping from nums1 to nums2 where # mapping[i] = j means the ith element in nums1 appears in nums2 at index j. # If there are multiple...
true
efaabae63cbd556d6e1a3d52a1bb39d61a163fab
Zahidsqldba07/codingbat-programming-problems-python
/Solutions/string-2/end_other.py
579
4.1875
4
# Given two strings, return True if either of the strings appears at # the very end of the other string, ignoring upper/lower case differences # (in other words, the computation should not be "case sensitive"). # Note: s.lower() returns the lowercase version of a string. # end_other('Hiabc', 'abc') → True # end_other(...
true
55ea429df48b2ae917a8239f40e1a12acad1179d
yasu094/learning-python
/10-calendars.py
1,139
4.15625
4
import calendar # print a text calendar (week start day is Sunday) c = calendar.TextCalendar(calendar.SUNDAY) str = c.formatmonth(2020, 1, 0, 0) print (str) # create an HTML formatted calendar hc = calendar.HTMLCalendar(calendar.SUNDAY) str = hc.formatmonth(2020, 1) print (str) # loop over the days of a month # zero...
true
fc74fe344919966935cef5b6eb206e92564af881
nseetim/Hackerrank_challenges
/String_Validators.py
2,562
4.34375
4
''' Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric characters, digits, etc. str.isalnum() This method checks if all the characters of a string are alphanumeric (a-z, A-Z and 0-9). >>> print 'ab123'.isalnum() True >>> print ...
true
819f06ff47d9843a78fb41d30b6960ab7c77c710
PapaGateau/Python_practicals
/089-Safe_list_get/safe_list_get.py
629
4.15625
4
def recuperer_item(liste, index): """function to get and element form a list using its index incorrect indexes are protected and will return an error string Args: liste ([list]): [list searched] index ([int]): [index of searched element] Returns: [str]: [list element or error s...
true