blob_id string | repo_name string | path string | length_bytes int64 | score float64 | int_score int64 | text string | is_english bool |
|---|---|---|---|---|---|---|---|
ce4f654a997c0416526e5ff5c182f8cfdc3c4bce | bekzod886/Python_darslari | /dictianary/maxsusMasala2.py | 546 | 4.125 | 4 | person1yoshi = int(input("Person1: "))
person2yoshi = int(input("Person2: "))
person1 = {
"name": "John",
"father": "Bill",
"mother": "Anna",
"married": 0
}
person2 = {
"name": "Kate",
"father": "Pet",
"mother": "Maria",
"married": 0
}
person3 = {}
person1["married"]=person1yoshi
person2... | false |
784bb535d6c61d3c472a9c97e28036ce90ccc571 | diamondsky/Python-Programs | /format_output.py | 812 | 4.25 | 4 | #format_output.py
def main():
temperature_str = input("Enter the temperature: ")
temperature = float(temperature_str)
count = int(input("Enter the number of students: "))
print("The temperature is " + str(temperature))
print("The number of students is " + str(count))
print("Students = " + forma... | true |
cf89bd90db0f7c22dbde753c825c6f25c80dcca5 | YManjunath/Python | /Guess-Number-Challenge-12/main.py | 1,196 | 4.15625 | 4 | from random import randint
from art import logo
print(logo)
easy_level = 10
hard_level = 5
# Checking the user guess against the answer
def check_answer(guess,answer,turns):
"""Checks the guess against answer and returns the remaining attempts """
if guess > answer:
print("Too high")
return turns -1
eli... | true |
58cdc9bdd0450221daa56633e2d55811a4ebc0ef | novinary/Data-Structures | /heap/max_heap.py | 2,664 | 4.125 | 4 | '''
In a max heap, each child node is less than or equal to parent node
'''
class Heap:
def __init__(self):
self.storage = []
# insert adds the input value into the heap; this method should ensure that the inserted value is in the correct spot in the heap
def insert(self, value):
self.storage.append(value... | true |
ec4c173b29ecab6b394c40b8be77aed312b7d083 | raja21068/Machine-Learning-Toturials | /49_Multiclass_Logistic_Regression.py | 2,155 | 4.40625 | 4 | #Logistic regression can also be used to predict the dependent or target variable with
#multiclass. Let’s learn multiclass prediction with iris dataset, one of the best-known
#databases to be found in the pattern recognition literature. The dataset contains 3 classes
#of 50 instances each, where each class refers to a ... | true |
b654aaf835cb1328ba2ef9907278663be0bb8f0e | JDanielHarvey/cms_tutorials | /Python_SQLite_Tutorial.py | 1,769 | 4.75 | 5 | """
Python SQLite Tutorial: Complete Overview - Creating a Database, Table, and Running Queries
https://www.youtube.com/watch?v=pd-0G0MigUA&t=37s
"""
import sqlite3
# conn_mem = sqlite3.connect(':memory:')
conn = sqlite3.connect('employee.db')
c = conn.cursor()
# c.execute("""CREATE TABLE employees (
# ... | false |
b93c3d8e6f5bfc9288a0dec2e90bd47883ea3afd | oWlogona/SS_exercise | /char_freq.py | 469 | 4.21875 | 4 | """Write a function char_freq() that takes a string and builds a
frequency listing of the characters contained in it. Represent the frequency
listing as a Python dictionary. Try it with something like
char_freq("abbabcbdbabdbdbabababcbcbab")."""
def char_freq(line=''):
if len(line):
ans_dict = {item: 0 for item ... | true |
cd1527a54199641f65d3b09750825a611e45af89 | anastasiia42/Interview-practice | /check_if_binary_search_tree.py | 1,685 | 4.21875 | 4 | # check if a binary tree is a binary search tree
class BinaryTreeNode(object):
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def insert_left(self, value):
self.left = BinaryTreeNode(value)
return self.left
def insert_right(self,... | true |
96aa84fc0b6ad809030616df64f99268b18d37c1 | sarah-fitzgerald/pands-problem-sheet | /collatz.py | 863 | 4.46875 | 4 | #This program asks user to input any positive integer
#Then outputs the successive values
#Author: Sarah Fitzgerald
#https://www.w3resource.com/python-exercises/challenges/1/python-challenges-1-exercise-23.php
x = int(input("Please enter a positive number: ")) # Asks user to input a positive number
def collatz(x): #... | true |
6c0e49392b047a2687624460a7d36dcb356ed99c | basfl/data-science | /ml/Regression/Simple Linear Regression/GPA_SAT/app.py | 1,187 | 4.15625 | 4 | from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
dataset = pd.read_csv("./resources/gpa-sat.csv")
"""
our DV is gpa and our IV is sat
"""
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 1].... | true |
01ad2ae9be1fd114b3821c355322bf3d288dd5ab | lyl0521/lesson-0426 | /lesson/day03/list_test.py | 668 | 4.375 | 4 | names = ['Tom','Jerry']
print(names)
print(names[0])
print(names[-1]) # last element
print(names[-2])
print(len(names))
names.append('Spike')
print(names)
names.insert(2,'Tyke')
print(names)
names[3] = 'Spike'
print(names)
names.pop() # 默认删除最后一个元素
names.pop(0) # 写入参数删除对应元素
print(names)
superstar = ... | false |
b640a0cf4f8c3e30f4bdab9abe852262aa2ccfe9 | ArtisanGray/python-exercises | /else-if.py | 377 | 4.34375 | 4 | # This program will take a numerical grade and give a letter grade output
grade = int(input("Enter your grade: "))
if (grade >= 90) and (grade <=100):
print("A")
elif (grade >=80)and(grade <=89):
print("B")
elif(grade >=70)and(grade <=79):
print("C")
elif(grade >=60)and(grade <= 69):
print("D")
else:
print("F")
#... | true |
dd8d121d8ba32dd8001e341f4bc5b8641a1f863e | ArtisanGray/python-exercises | /tic-tac-toe-pt3-UNFINISHED.py | 1,340 | 4.375 | 4 | print ("TIC TAC TOE board. Rows and Columns starting from 1,1")
print ("Game board is printed each time to show progress!")
# Declare the blank game
game=[[0,0,0],
[0,0,0],
[0,0,0]]
count = 0
# create the print gameboard function
def print_game(game):
print ("\n")
for i in range... | true |
d422f486d04edc5f363c4c144a077d1954b47309 | ArtisanGray/python-exercises | /check-elements-of-input-array.py | 669 | 4.125 | 4 | # Use your code from the last exercise.
# Now check to see how many of a number are in the array.
# Hint: use the code from the examples in class.
# Use your code from the last exercise.
numbers = []
input_len = int(input("How many elements do you want?: ") )
# Now use a for loop to add to the array.
for index in ... | true |
5685876f0ed8c7c70d5fa262ce6558f0a786fd03 | susansfy/pythonBasic | /爬虫/get请求.py | 333 | 4.125 | 4 |
'''
特点:把数据
优点:速度快
缺点:承载的数据小,不安全
'''
import urllib.request
url = ""
response = urllib.request.urlopen(url)
data = response.read().decode("utf-8")
print(data) #字符串类型
#但实际上响应数据大多数是json格式的字符串
#json viwer软件,查看json的层次
| false |
17d710df2cf9ababbe9ca0939c89d21ad721e981 | TanakitInt/Python-Year1-Archive | /In Class/Week 14/Palindrome.py | 328 | 4.125 | 4 | """Palindrome"""
def main():
"""start"""
text = str(input())
text_invert = list(text)
text_invert = text_invert[::-1]
new = ''
new = new.join(text_invert)
text_invert = new
if text == text_invert:
print(text, "is Palindrome.")
else:
print("This is not Palindrome")... | false |
74631801eb5e74b9edb65763a68e0d5f6af863eb | TanakitInt/Python-Year1-Archive | /In Class/Week 3/quadratic solve issue when crash (q14 HW).py | 2,200 | 4.34375 | 4 | #--------------------------Information------------------------------#
#Tanakit Intaniyom DSBA
#Assignment Week 3
#Question number 14
#Last updated on 26/08/2017 at 02.44 am
#-------------------------------------------------------------------#
# quadratic.py
# A program that computes the real roots of a quadratic eq... | true |
b9aac0c9b30875d909bf13d6157799c6668d86b9 | TanakitInt/Python-Year1-Archive | /In Class/Week 5/max_speed.py | 663 | 4.21875 | 4 | """Max speed"""
def traffic():
"""go drive!"""
speed_limit = int(input())
current_speed = int(input())
fine = 0
#when drive illegal but not more than 90
if current_speed > speed_limit and current_speed <= 90:
fine = 50 + abs((speed_limit-current_speed)*5)
print("The speed is ille... | true |
e0d5e2f0e7509f1415756a6749a9c4383d6333da | Afterives/LearnPython | /dayFour.py | 901 | 4.125 | 4 | # Dzień 4 z pythonem
# Sety, czyli zbiory
# Zbiór to lista, w której nie ma dwóch identycznch elementów
thisset = {"apple", "banana", "cherry"}
print(thisset)
# Nie możemy uzyskać dostępu poprzez odwołanie się do indeksu setu, za to możemy wypisać elementy dzięki pętli for
for x in thisset:
print(x)
# Dodawanie ... | false |
b2b1ec727846ee12bef756ae51d873de04af9410 | robertz23/code-samples | /python scripts and tools/palindrome_prime.py | 1,359 | 4.40625 | 4 | """
Find the highest palindromic prime
number between 1 and 1000
"""
def is_prime(num):
"""
Checks if a number is prime
"""
prime_counter = 1
for x in range(1, num):
if num % x == 0:
prime_counter += 1
if prime_counter > 2:
return False
return True
def ... | true |
4400a20127476249bbc6ea7240e6718d792aa260 | McLeedle/python-projects | /Example4 Conditionals/example4.py | 738 | 4.125 | 4 | print "This is our forth example and will cover conditionals and control flow"
# create function storestock with a variable of instock
def storestock(instock):
print "This store has %s Items in stock." % (str(instock))
# conditional parameters to evaluate if instock is true and prints if true
if instock == 4... | true |
69e21a1b59751503111f0903d93d6e90a8392d16 | csgray/IPND_lesson_4 | /lesson_4-4.py | 1,861 | 4.34375 | 4 | """Lesson 4.4: Modulus & Dictionaries
Modulus Operator %
<number> % <modulus> -> <remainder>
14 % 12 -> 2
"""
"""Lesson 4.4: Dictionaries
Dictionaries are another crucial data structure to learn in Python in
addition to lists. These data structures use string keywords to access
data rather than an index number in li... | true |
e0b42545cf9394ae335d92d6e9d8dc2a1e6a8143 | UrszulaP/Learning-JavaScript-30days | /04 - Array Cardio Day 1/python_version.py | 1,424 | 4.125 | 4 | # 1. Filter the list of inventors for those who were born in the 1500's
result = list(filter(lambda x: x["year"] >= 1900 and x["year"] < 2000, inventors))
print(result)
# ZMIENIĆ NA LISTĘ STRINGÓW
# 2. Give us an array of the inventors first and last names
result = list(map(lambda x: {x["first"], x["last"]}, inventors... | true |
7c8ec39deea879435ea3166fd31fa71d17d854ec | aba00002/Lab3-Python | /Lab3_Exercise10.py | 305 | 4.375 | 4 | #Program that will compute MPG (Miles covered Per Gallon used) for a car
#Where M is miles driven and G is gallon used
M = int(input("enter the number of miles driven"))
G = float(input("enter the number of gallons used"))
MPG = (M / G)
print("Dear driver, the mile per gallon rate of your car is", MPG)
| true |
396012585de01ddc15a212334393e736cf3238ff | satishr01k/Python_Tasks | /variablestask.py | 1,981 | 4.59375 | 5 |
#1. Create three variables in a single line and assign different values to them and make sure their data types are different. Like one is int, another one is float and the last one is a string.
a, b, c=10, 11.5, 'satish'
print(a)
print(b)
print(c)
# 2. Create a variable of value type complex and swap it with ano... | true |
5ca48e454b86c5e709b3d4a698937776e014c04d | PePPers258/PRIMER-PROGRAMA | /Adivina_tu_numero.py | 475 | 4.125 | 4 | number_to_guess = 0
number_to_guess = int(input("Para continuar, introduce un numero para que alguien mas lo adivine, fijate que no lo vea (numeros entre el 1 y 100): "))
user_number = int(input("Adivina un numero: "))
while number_to_guess < user_number or number_to_guess > user_number:
print("Has fallado, inten... | false |
954e5771d75b2a1122c3d92cc7985d308402320a | mik-79-ekb/Python_start | /Lesson_2/HW_2.3.py | 791 | 4.15625 | 4 | """
Task 2.3
"""
year_list = ["Зима", "Зима", "Весна", "Весна", "Весна", "Лето", "Лето", "Лето", "Осень", "Осень", "Осень", "Зима",]
year_dic = {1: "Зима",
2: "Зима",
3: "Весна",
4: "Весна",
5: "Весна",
6: "Лето",
7: "Лето",
8: "Лето",
... | false |
969f76a0b45f7aee2e017b12579d8cd3cad1f68b | LouJi/PyUnitTest2 | /functionz.py | 1,915 | 4.25 | 4 | from math import *
def add (x,y):
#Add function
if type(x) in [bool]:
raise TypeError('The operands must be a real number')
if type(y) in [bool]:
raise TypeError('The operands must be a real number')
#if type(x, y) not in [int, float, str]:
#raise TypeError('The operands must b... | true |
5add4ae6f07d5713cca14f0b251bdb2941377379 | AymaneZizi/dailyreader | /common/stemming.py | 705 | 4.1875 | 4 | alphabets={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}
def is_not_alphanumeric(word):
option=0
returnValue=1
while option<len... | false |
c7dd3e6d4d38ced899bd5ff4be66a456252b0fd3 | AnDr10wA/tms-21 | /Task_7_full/task_7full_6.py | 503 | 4.46875 | 4 | """
Создать функцию, которая принимает на вход
неопределенное количество аргументов и возвращает их
сумму и максимальное из них.
"""
def func(*args):
print(args)
sum1 = sum(args)
max1 = max(args)
return sum1, max1
func1 = func(1, 4, 5 ,23, 23, 11, 21)
print(f"Сумма элементов равна {func1[0]}")
print(... | false |
5ef08a06702238a16fb0148ad228bfa4712c2814 | young-geng/leet_code | /problems/170_two-sum-iii-data-structure-design/main.py | 1,417 | 4.15625 | 4 | # https://leetcode.com/problems/two-sum-iii-data-structure-design/
# Design and implement a TwoSum class. It should support the following operations: add and find.
#
# add - Add the number to an internal data structure.
# find - Find if there exists any pair of numbers which sum is equal to the value.
#
# For example,
... | true |
a9048140fd89a0ddd754998f28406df67c157237 | nshirajee/pythonLab9 | /Lab9_07.py | 698 | 4.375 | 4 | #function to calculate Fibonacci sequence
def fibonaccisequence(number):
#Initialize variable
#second seq starts with 1
firstseq = 0
secondseq = 1
#loop through number of sequence parameter
for x in range(number):
#only print second seq, first time it'll print 1, after that it'll print b... | true |
47e9a81d6f11a776c21a0212c1ca562c77fd2eae | gujunwuxichina/python_basic | /com/gujun/变量和简单类型/number/float.py | 323 | 4.1875 | 4 | # 浮点型
# 浮点型数值表示带有小数点的数值
# 两种表示形式:
# 1.十进制,浮点数必须包含一个小数点,否则会被当成整型;
# 2.科学计数法,3.14e12,只有浮点型才能使用科学计数法;
a=1.
print(type(a)) # <class 'float'>
b=100e5
print(type(b)) # <class 'float'> | false |
6457791201c288cedf1fed76ebb1d8d84c0d2a62 | Ahsank01/Python-Crash-Course | /String/String.py | 1,407 | 4.5 | 4 | # Name: Ahsan Khan
# Date: 09/15/2020
# Description: Using string and its built-in functions, and manipulating the string.
# the function .title() will make the first initial a capital letter
name = "ahsan khan"
print(name.title())
#------------------------------------------------------------------#
# the ... | true |
5b4450467c870a1b744ffae3002531f8d2c201aa | Ahsank01/Python-Crash-Course | /User Input and While loop/Introducing_while_loops.py | 2,380 | 4.15625 | 4 | # Name: Ahsan Khan
# Date: 10/06/20
# Description: Intro to while loops and user input
current_number = 1
while current_number <= 5:
print(current_number)
current_number += 1
# ================================================================ #
prompt = "\nTell me something, and I will repeat it back to you. "
pr... | true |
e7fef2eedf81f18684d7189811f2c4b880c84953 | Ahsank01/Python-Crash-Course | /Dictonaries/Exercises/Polling.py | 822 | 4.1875 | 4 | # Name: Ahsan Khan
# Date: 09/29/20
# Description: Make a list of people who should take the favorite language poll.
# Loop through the list of people who should take the poll.
# If they have already taken the poll, print a message thanking them for responding.
# If they haven... | true |
0bcb649346aeb69b41da7c9e562fad76306d2fc2 | Ahsank01/Python-Crash-Course | /IF_Statement/if_statement.py | 2,343 | 4.21875 | 4 | # Name: Ahsan Khan
# Date: 09/23/20
# Description: Get familiar with Python IF STATEMENT
cars = ['honda', 'mercedes', 'toyota', 'bmw']
for car in cars:
if car == 'bmw':
print(car.upper())
else:
print(car.title())
# --------------------------------------------------------- #
#Checking for ineq... | true |
18500750e494ad9f454ea29482444551832087db | Gafanhoto742/Python-3 | /Python (3)/Ex_finalizados/ex027.py | 369 | 4.15625 | 4 | # Exercício Python 027: Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o último nome separadamente.
nome = str(input('Digite o seu nome completo: ')).strip().upper()
n = nome.split()
print ('Muito prazer em te conhecer!')
print('Seu primeiro nome é:{}' .format(n[0]))
print('... | false |
a33768e96dcdca65b8cfcc4719693a09d5ce1ced | Gafanhoto742/Python-3 | /Python (3)/Ex_finalizados/ex095.py | 1,935 | 4.28125 | 4 | '''Aprimore o desafio 93 para que ele funcione com vários jogadores,
incluindo um sistema de visualização de detalhes do aproveitamento de cada jogador.'''
jogador = {}
ngols = [] # número de gols
ljogadores = [] # Lista de jogadores
soma = j = 0
print ('='*60)
print (f'\033[7;30;39m{"CADASTRO DE JOGADOR":^60}\033... | false |
0586323efb3299b119d17034d91e0a8553c72be9 | ortizjs/algorithms_ | /python-practice/command_line_calendar.py | 2,660 | 4.53125 | 5 | """In this project, we'll build a basic calendar that the user will be able to interact with from the command line. The user should be able to choose to:
View the calendar
Add an event to the calendar
Update an existing event
Delete an existing event
The program should behave in the following way:
Print a welcome mes... | true |
7fc53c96a3cfdadd93c48fffd1c1179c52119ef4 | ortizjs/algorithms_ | /InterviewCakeProblems/reverse_words.py | 1,853 | 4.125 | 4 | # def reverse_words(message):
# mess1 = "".join(message)
# # print mess1
# mess2 = mess1.split(" ")
# # print mess2
# lower = 0
# upper = len(mess2) - 1
# while lower < upper:
# temp = mess2[lower]
# mess2[lower] = mess2[upper]
# mess2[upper] = temp
# lower +=... | true |
a4ee1cb6352cb07b932d1b8c0540c2326a02fdd9 | ortizjs/algorithms_ | /python-practice/permutation_palindrome.py | 788 | 4.28125 | 4 | # Write an efficient function that checks whether any permutation of an input string is a palindrome.
# You can assume the input string only contains lowercase letters.
# Examples:
# "civic" should return True
# "ivicc" should return True
# "civil" should return False
# "livci" should return False
def permutation_p... | true |
0e8619e739be81640b2d3ceefd204b3b1cc719e8 | dmellors/raspberry_pi_projects | /led_dice.py | 2,066 | 4.25 | 4 | # Simulate a random dice roll with LED's
import RPi.GPIO as GPIO
import time
import random
# list containing LED GPIO pin numbers
LED = [18,23,24,25]
button = 7
# set GPIO mode of operation to BCM
GPIO.setmode(GPIO.BCM)
# disable GPIO warning events if pin already in use
GPIO.setwarnings(False)
# Initialise the op... | true |
a345653ad591247131defb6abcffe2a27112104c | zingpython/february2018 | /day_one/Exercise5.py | 257 | 4.1875 | 4 | side1 = input("Enter a side: ")
side2 = input("Enter a side: ")
side3 = input("Enter a side: ")
if side1 == side2 and side2 == side3:
print("Equilateral")
elif side1 == side2 or side2 == side3 or side1 == side3:
print("Isosceles")
else:
print("Scalene") | false |
e336c02a69906b8398611692056c7321f42a1403 | zingpython/february2018 | /day_six/insertionSort.py | 1,201 | 4.40625 | 4 | #Create function for insertion sort. This takes in a list to be sorted
def insertionSort(starting_list):
#Index is the current index we are comparing and sorting
index = 0
#Run the code until every index has been sorted
while index < len(starting_list):
print(starting_list)
#FOr each index check every index ... | true |
d7301742aa00db6f8eb207b5927db0cc43e472d3 | jsong00505/CodingStudy | /coursera/algorithms/part1/week2/stacks_and_queues/permutation.py | 401 | 4.1875 | 4 | from coursera.algorithms.part1.week2.stacks_and_queues.randomized_queue import RandomizedQueue
class Permutation:
def __init__(self, k, s):
self.k = k
self.s = s.split()
def permutation(self):
queue = RandomizedQueue()
for i in self.s:
queue.enqueue(i)
it ... | false |
08f30ed72d62fc7864c105c3c4297c081cf69343 | ArhamChouradiya/Python-Course | /07dictionary.py | 359 | 4.15625 | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 4 02:15:36 2019
@author: arham
"""
dict={1:"John",2:"Bob",3:"Bill"}
#print(dict)
#print(dict.items())
k=dict.keys()
for i in k: #access keys
print(i)
v=dict.values()
for i in v: #access values
print(i)
#print(dict[3])
... | false |
835bc940203b3a7ce1d71ac96d756409334c5c18 | Dallas-Johnson-Dev/AlgorithmsLowestCostPath | /lowestcost.py | 2,030 | 4.125 | 4 | """
Python Program written to find the lowest cost path from the bottom row of a grid to the top.
Written by Dallas Johnson
Requires one input which is the size of the grid. The grid is an N x N size grid, so only one positive integer is needed.
"""
import random
from sys import argv
class GridTile:
value = None... | true |
205c589c1f5b97c86b5fa75481d6b87577f6457f | Preetpalkaur3701/Python | /bitonic_sort.py | 1,616 | 4.28125 | 4 | # Python program for Bitonic Sort. Note that this program
# works only when size of input is a power of 2.
# The parameter direction indicates the sorting direction, ASCENDING
# or DESCENDING; if (a[i] > a[j]) agrees with the direction,
# then a[i] and a[j] are interchanged.
def compAndSwap(array, i, j, direction):
... | true |
09bfa0b20170187deeef2b87220cd36f6bcfe7e4 | Preetpalkaur3701/Python | /order.py | 375 | 4.3125 | 4 | # Append Dictionary Keys and Values ( In order ) in dictionary
from itertools import chain
# initializing dictionary
my_dict = {"I" : 1, "am" : 3, "the" : 2, "BEST" : 4}
print("The original dictionary is : " + str(my_dict))
#appending the dictionary
new_dict = list(chain(my_dict.keys(), my_dict.values()))
print("... | true |
a1e87853999274b199f412078a7f4dba9c5fb440 | shills112000/django_course | /PYTHON/DATE-CALENDAR/patch_tuesday.py.old | 2,199 | 4.3125 | 4 | #!/usr/bin/python3.6
import calendar
import datetime
#https://www.w3schools.com/python/python_datetime.asp
x = datetime.datetime.now()
#print(x)
#print(x.year)
#print(x.month)
#print(x.day)
#print(x.strftime("%A")) # FULL DAY
#print(x.strftime("%b")) # short month
#print(x.strftime("%B")) # full month
# Show every m... | true |
9487d17d790c6f66438d80d4cedba7b778d105a7 | shills112000/django_course | /PYTHON/STATEMENTS_WHILE_FOR_IF/useful_operators.py | 1,733 | 4.15625 | 4 | #!/usr/local/bin/python3.7
mylist = [1,2,3]
#range (start,stop[,step[])
# This will pring all number up to 10 starting at 0
for num in range(10):
print (num)
for num in range(3,10): # start are 3 go up to 10
print (num)
for num in range(0,10,2): # start at 0 going to up to 10 steping two at a time , even ... | true |
8302bfb9bcb5228c8a0ac92d63bbafcf7937adb9 | shills112000/django_course | /PYTHON/OBJECT_ORIENTATED_PROGRAMING/polymorphism.py | 993 | 4.25 | 4 | #!/usr/local/bin/python3.7
#Inheritance
#form new classes using classes that have already been defined.
# polymophism , refers to the way in different object classes can share same method name.
class Animal(): # Base class
def __init__(self,name):
self.name = name
def speak(self):
raise No... | true |
c1aa7cef2ceb1b17887c45cf442ef7b6ece52ceb | shills112000/django_course | /PYTHON/STATEMENTS_WHILE_FOR_IF/boolean_comparisons.py | 740 | 4.15625 | 4 | #!/usr/local/bin/python3.7
print( 2 == 2) # True
print( 2 == 1) # False
print ( 'hello' == 'bye') # False
print ('2' == 2 ) # False as one is a string, one is a number
print (2.0 == 2 ) # True even when using ints and floating points
print (3 != 3) # False as 3 is = 3
print (4 != 5) # true 4 is not equal to 5
p... | true |
89e3818196b7c7364fc2e5b4369eb63213be9471 | juliocesardiaz/lpthw | /ex33/ex33.py | 479 | 4.15625 | 4 | def looper(x, increment):
i = 0
numbers = []
while i < x:
print "At the top i is %d" % i
numbers.append(i)
i += increment
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
print "The numbers: "
for num in numbers:
print num
def fo... | true |
9679509720a8f00a1fc92285f6bc4110dd1ec9e4 | karolinanikolova/SoftUni-Software-Engineering | /3-Python-Advanced (May 2021)/02-Tuples-and-Sets/02_Exercises/02-Sets-of-Elements.py | 859 | 4.15625 | 4 | # 2. Sets of Elements
# Write a program that prints a set of elements. On the first line, you will receive two numbers - n and m,
# which represent the lengths of two separate sets. On the next n + m lines you will receive n numbers,
# which are the numbers in the first set, and m numbers, which are in the second set.
... | true |
be15efd47f50e86e0f1a2c10ad0aa47372b34fc1 | karolinanikolova/SoftUni-Software-Engineering | /3-Python-Advanced (May 2021)/04-Comprehensions/02_Exercises/07-Flatten-Lists.py | 497 | 4.375 | 4 | # 7. Flatten Lists
# Write a program to flatten several lists of numbers, received in the following format:
# String with numbers or empty strings separated by '|'.
# Values are separated by spaces (' ', one or several)
# Order the output list from the last to the first received, and their values from left to rig... | true |
85261586cefefbe35e2d0bb6949de0e17d85dbf9 | karolinanikolova/SoftUni-Software-Engineering | /3-Python-Advanced (May 2021)/01-Lists-as-Stacks-and_Queues/02_Exercises/07-Robotics-NOT-DONE.py | 2,424 | 4.125 | 4 | # 7. *Robotics
# Somewhere in the future, there is a robotics factory. The current project is assembly line robots.
# Each robot has a processing time – it is the time in seconds the robot needs to process a product.
# When a robot is free it should take a product for processing and log his name, product and processing... | true |
d241f7c3c5539d110722527a197dba0560112b18 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/00-Exam-Prep/01_Mid_Exam_Prep/03-Programming-Fundamentals-Mid-Exam-Retake/01-Counter-Strike.py | 1,467 | 4.25 | 4 | # Problem 1. Counter Strike
# Write a program that keeps track of every won battle against an enemy.
# You will receive initial energy.
# Afterwards you will start receiving the distance you need to go to reach an enemy until the "End of battle" command is given, or until you run out of energy.
# The energy you need fo... | true |
2ada51562fcc5a4ca7001ec06c36fe59cfeb906a | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/06-Objects-and-Classes/02_Exercises/06-Inventory.py | 1,311 | 4.1875 | 4 | # 6. Inventory
# Create a class Inventory. The __init__ method should accept only the capacity of the inventory.
# The capacity should be a private attribute (__capacity). You can read more about private attributes here.
# Each inventory should also have an attribute called items, where all the items will be stored. Th... | true |
e2440695bc953bf52f81cdc173fd65332e977049 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/01-Basic-Syntax-Conditional-Statements-and-Loops/02_Exercises/04_Double-Char.py | 269 | 4.25 | 4 | # 4. Double Char
# Given a string, you have to print a string in which each character (case-sensitive) is repeated.
text = input()
# for char in text:
# print(char * 2, end='')
result_text = ''
for char in text:
result_text += 2 * char
print(result_text)
| true |
07163e679661baceb76c37114044834ae6399e59 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/09-Regular-Expressions/02_Exercises/01-Capture-the-Numbers.py | 470 | 4.34375 | 4 | # 1. Capture the Numbers
# Write a program that finds all numbers in a sequence of strings.
# The output is all the numbers, extracted and printed on a single line – each separated by a single space.
import re
text_line = input()
pattern = r"\d+"
all_numbers = []
# while not text_line == "":
while text_line:
nu... | true |
c5d08c23be0a89c4ab2bfffbe278b44f47b21b56 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/04_For-Loop/01.Lab-05-Character-Sequence.py | 386 | 4.28125 | 4 | # 5. Поток от символи
# Напишете програма, която чете текст(стринг), въведен от потребителя и печата всеки символ от текста на отделен ред.
text = input()
for i in range(0, len(text)):
print(text[i])
# # Other method:
# text = input()
#
# for i in text:
# print(i)
| false |
abbfbafe78e9d27763b339725b8ec35a4a46d1c9 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/01_First-Steps-in-Coding/03.More-Exercise-10-Weather-Forecast-Part-2.py | 862 | 4.46875 | 4 | # 10. Прогноза за времето – част 2
# Напишете програма, която при въведени градуси (реално число) принтира какво е времето, като имате предвид следната таблица:
# Градуси Време
# 26.00 - 35.00 Hot
# 20.1 - 25.9 Warm
# 15.00 - 20.00 Mild
# 12.00 - 14.9 Cool
# 5.00 - 11.9 Cold
# Ако се въведат градуси, различни от посоче... | false |
4c071d858db81b95e975f8a0343ecf822b5015f7 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/01_First-Steps-in-Coding/02.Exercise-02-Rad-to-Deg.py | 627 | 4.25 | 4 | # 2. Конзолен конвертор: от радиани в градуси
# Напишете програма, която чете ъгъл в радиани (rad) и го преобразува в градуси (deg). Принтирайте получените градуси като цяло число използвайки math.floor.
# Използвайте формулата: градуси = радиани * 180 / π. Числото π в Python може да достъпите чрез модула
from math i... | false |
d9412baec333d4eeca3624fbff2282a1e7b47e26 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/03_Conditional-Statements-Advanced/00.Book-Exercise-4.1-04-Fruit-or-Vegetables.py | 656 | 4.34375 | 4 | # плод или зеленчук
# Нека проверим дали даден продукт е плод или зеленчук. Плодовете "fruit" са banana, apple, kiwi, cherry, lemon и grapes.
# Зеленчуците "vegetable" са tomato, cucumber, pepper и carrot. Всички останали са "unknown"
product = input()
if product == 'banana' or product == 'apple' or product == 'kiwi'... | false |
1f38f6f6c5589bb6af149a195593be239f59de2d | karolinanikolova/SoftUni-Software-Engineering | /3-Python-Advanced (May 2021)/04-Comprehensions/01_Lab/01-ASCII-Values.py | 298 | 4.28125 | 4 | # 1. ASCII Values
# Write program that receives a list of characters separated by ", " and creates a dictionary with each character
# as a key and its ASCII value as a value. Try solving that problem using comprehensions.
dictionary = {ch: ord(ch) for ch in input().split(', ')}
print(dictionary) | true |
c84a065c48fcf55dfb3b9cabef4b7ebb3a5daa30 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/01_First-Steps-in-Coding/00.Book-Exercise-2.1-09-Celsius-to-Fahrenheit.py | 409 | 4.5 | 4 | # cantilever converter - from degrees ° C to degrees ° F
# Write a program that reads degrees on the Celsius scale (° C) and converts them to degrees on the Fahrenheit scale (° F).
# Search the Internet for a suitable formula to perform the calculations. Round the result to 2 characters after the decimal point .
celsi... | true |
8ab62ad0f771f7a9ff9584f8658ba95b43e9eeca | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/01_First-Steps-in-Coding/00.Book-Exercise-2.1-02-Inch-to-cm.py | 216 | 4.5 | 4 | # transfer from inches to centimeters
# Let's write a program that reads a fractional number in inches and turns it into centimeters:
inches = float(input('Inches = '))
cm = inches * 2.54
print('Centemeters = ', cm) | true |
8234875c60ac230a706483af3dafb4607ee676a2 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/05-Lists-Advanced/02_Exercises/01-Which-are-in.py | 544 | 4.125 | 4 | # 1. Which Are In?
# Given two lists of strings print a new list of the strings that contains words from the first list which are substrings
# of any of the strings in the second list (only unique values)
first_string = input().split(", ")
second_string = input().split(", ")
result = []
result = [el_1 for el_1 in fi... | true |
a0789b7ead629decb63e12a02a564f5714f3662f | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/01-Basic-Syntax-Conditional-Statements-and-Loops/01_Lab/02_Number-Definer.py | 655 | 4.375 | 4 | # 2. Number Definer
# Write a program that reads a floating-point number and prints "zero" if the number is zero.
# Otherwise, print "positive" or "negative". Add "small" if the absolute value of the number is less than 1,
# or "large" if it exceeds 1 000 000.
number = float(input())
if number == 0:
print('zero')... | true |
ab300331451196893a2ee98a123402acfcf8ac20 | karolinanikolova/SoftUni-Software-Engineering | /3-Python-Advanced (May 2021)/01-Lists-as-Stacks-and_Queues/02_Exercises/06-Balanced-Parentheses.py | 1,592 | 4.125 | 4 | # 6. Balanced Parentheses
# You will be given a sequence consisting of parentheses. Your job is to determine whether the expression is balanced.
# A sequence of parentheses is balanced if every opening parenthesis has a corresponding closing parenthesis that occurs
# after the former. There will be no interval symbols ... | true |
a99ae46ca13a1dc80d2c1f8e9ccda8c1bb8d7186 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/00-Exam-Prep/01_Mid_Exam_Prep/04-Programming-Fundamentals-Mid-Exam/02-Shopping-List.py | 1,797 | 4.21875 | 4 | # Problem 2. Shopping List
# It’s the end of the week and it is time for you to go shopping, so you need to create a shopping list first.
# Input
# You will receive an initial list with groceries separated by "!".
# After that you will be receiving 4 types of commands, until you receive "Go Shopping!"
# • Urgent {item}... | true |
12a2374d1ad6933ce1c608be3db936c602be1563 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/05-Lists-Advanced/02_Exercises/04-Office-Chairs.py | 2,135 | 4.1875 | 4 | # 4. Office Chairs
# So you've found a meeting room - phew! ' \
# 'You arrive there ready to present, and find that someone has taken one or more of the chairs!! ' \
# 'You need to find some quick.... check all the other meeting rooms to see if all of the chairs are in use.
# You will be given a number n re... | true |
74894d7a10bd1878b8975413aa84e9eff487c2e0 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/04-Functions/02_Exercises/01-Smallest-of-Three-Numbers.py | 415 | 4.34375 | 4 | # 1. Smallest of Three Numbers
# Write a function which receives three integer numbers and returns the smallest. Use appropriate name for the function.
def smallest_of_three_numbers(num1, num2, num3):
return min(num1, num2, num3)
first_number = int(input())
second_number = int(input())
third_number = int(input()... | true |
72e0d3596a600d4c1366bd720c0048b3e7497a40 | karolinanikolova/SoftUni-Software-Engineering | /2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/04-Functions/01_Lab/01-Grades.py | 695 | 4.3125 | 4 | # Write a function that receives a grade between 2.00 and 6.00 and prints the corresponding grade in words
# • 2.00 – 2.99 - "Fail"
# • 3.00 – 3.49 - "Poor"
# • 3.50 – 4.49 - "Good"
# • 4.50 – 5.49 - "Very Good"
# • 5.50 – 6.00 - "Excellent"
def convert_grade_to_text_grade(grade_as_num):
if 2 <= grade_as_num <= 2.... | true |
5d085e1b34012f7a8ae1ce129a77bd77c51bbad3 | karolinanikolova/SoftUni-Software-Engineering | /1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/03_Conditional-Statements-Advanced/00.Book-Exercise-4.1-02-Small-Shop.py | 1,351 | 4.15625 | 4 | # квартално магазинче
# Предприемчив българин отваря по едно квартално магазинче в няколко града с различни цени за следните продукти:
#
# По даден град (стринг), продукт (стринг) и количество (десетично число) да се пресметне цената.
product = input()
city = input()
quantity = float(input())
price = 0
if city == 'So... | false |
65d9e7e6eb505218efc0da6b5ff7fbe8f7797d46 | shivamrastogi4/MyProject | /Matrix.py | 1,109 | 4.1875 | 4 | from numpy import *
arr = array([('shivam', 22, 3, 4), (1, 2, 3, 4)])
arr1 = array([
[1, 2, 3, 4, 5, 6],
[5, 6, 7, 8, 9, 10]
])
arr11 = array([
[1, 2, 3, 4],
[5, 6, 7, 8]
])
# print(arr.dtype) print(arr1.ndim) print(arr.shape)
print(arr.size) # size of entire block i.e. how manny element... | true |
3adb3e9b17f458acec92bbbeb30f66846ed55d4a | SACHSTech/ics2o-livehack1-practice-Tyler-Ku | /minutes_days.py | 667 | 4.3125 | 4 | """
-------------------------------------------------------------------------------
Name: minutes_days.py
Purpose: Write a program that lets you enter a number of minutes, and that will calculate
the number of days, hours and minutes that represents (Hint: use the modulus operator).
Author: Ku.T
Created: 02/09... | true |
02590ed7b8c9120798df10e7182a9afc2a1e35ca | Lormenyo/Data-Structures-And-Algorithms | /linkedlist.py | 2,357 | 4.4375 | 4 | # singly linked list is a collection of nodes
# head and tail of a linkedlist
# going through the nodes is called traversing the linkedlist(link hopping or pointer hopping)
# Linked list does not have a predetermined fixed size
# It uses space proportionally to the number of elements
# nodes are pointers ... | true |
ab122b9bc224e4f975015703d25328507ddf681a | SEEVALAPERIYA/python | /palindrome or not .py | 288 | 4.15625 | 4 | num=input('enter any number:')
try:
val=int(num)
if num==str(num)[::-1]:
print('the given number is palindrome')
else:
print('the given number is not palindrome')
except value error:
print("that' 5 not a valid number,try again!")
| true |
55cdc37d569e34e14015d514f9cf82701915a070 | ebnezerdaniel/PythonPractise | /CircleArea.py | 400 | 4.15625 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[9]:
#solving directly using the formula
# In[12]:
Circle=float(input('Radius of Circle:'))
Area=(22/7)*(Circle**2)
print('Area of a circle', Area)
# In[ ]:
# In[10]:
#importing math package and pi function
# In[11]:
from math import pi
Circle=float(input... | true |
e7534d1e0ccaf9b3818a4d2852c2a6780805899b | game-racers/Python-Projects | /Computer Science 131/Lab4/Lab4Q1 RPS.py | 2,784 | 4.1875 | 4 | import random
userWins = 0
compWins = 0
ties = 0
playing = "yes"
cF = 1
while playing == "yes" or playing == "Yes" or playing == "y":
while cF == 1:
player = str(input("Rock, Paper, or Scissors? "))
if player == "rock" or player == "Rock":
cF = 0
player = "Rock... | true |
76bcdf6d4d3ee2ebeefff6d67e251ff771086103 | iAbhishek91/algorithm | /basics/20_for.py | 240 | 4.5 | 4 | # for loops are used for special purpose, looping through collection for example
for char in "cat":
print(char)
for item in [10, 20, 30]:
print(item)
for index in range(5):
print(index)
for num in range(3, 8):
print(num) | true |
e2abc9a3b5f54cd6699b37968bd9ebd06907ff56 | siuols/Python-Basics | /strings.py | 2,216 | 4.21875 | 4 | def init():
input_string = input("Enter a string: ")
count = 0
upper_string(input_string)
lower_string(input_string)
count_string(input_string)
convertion_to_list(input_string)
indexing(input_string)
count_string(input_string)
reverse(input_string)
slicing(input_string)
start... | true |
87301903697605cf31598371c50d0ca080f70a40 | tigju/Data-Structures | /stack/stack.py | 2,016 | 4.1875 | 4 | """
A stack is a data structure whose primary purpose is to store and
return elements in Last In First Out order.
1. Implement the Stack class using an array as the underlying storage structure.
Make sure the Stack tests pass.
2. Re-implement the Stack class, this time using the linked list implementation
as th... | true |
77b7c59fe238344aa47f0bc163b949029bec514b | roseleonard/Calculator | /clac.py | 2,554 | 4.25 | 4 | # print("Hello calculator")
# #Add 2 numbers
# number1 = input("Give me a number.")
# number2 = input("What's the second number?")
# def addition(number1,number2):
# step1 = int(number1) + int(number2)
# return step1
# def mulitplication(number1,number2):
# step1 = int(number1) * int(number2)
# retur... | true |
0504ecb6223a0ddeeac88283648cedc4a4245be8 | AdriGeaPY/programas1ava | /zprimero/IF/5.simbolo.py | 270 | 4.3125 | 4 | print("digame un simbolo")
simbolo=input()
if simbolo == "1"or simbolo =="2"or simbolo =="3"or simbolo =="4"or simbolo =="5"or simbolo =="6"or simbolo =="7"or simbolo =="8"or simbolo =="9"or simbolo =="0":
print("esto es un digito")
else:
print("esto es un simbolo") | false |
48855e160b7e907ba6f977f791d3214bde446487 | nidhi76/PPL20 | /assign4/shapes/s-p/inhe14.py | 683 | 4.5625 | 5 | # draw color filled circle in turtle
import turtle
# creating turtle pen
t = turtle.Turtle()
# taking input for the radius of the circle
r = int(input("Enter the radius of the circle: "))
# taking the input for the color
col = input("Enter the color name or hex value of color(# RRGGBB): ")
# set the fillco... | true |
cc20bebc598d46425282f7fea40b75d09d2a005c | tapanprakasht/Simple-Python-Programs | /palindrome.py | 420 | 4.375 | 4 | #!/usr/bin/python3
# Program to check the given string is palindrome or not
def main():
str=input("Enter the string:")
length=len(str)
length=length-1
i=0
flag=True
while i<=length:
if str[i]!=str[length]:
flag=False
break
i+=1
length-=1
if flag==False:
print("{} is not palindr... | true |
72e1c0f68d30f93c2a3f3c6cbee42dfc803e226d | tapanprakasht/Simple-Python-Programs | /Amstrong.py | 595 | 4.15625 | 4 | #!/usr/bin/python3
# Program to check whether the given number is amstrong or not
class Amstrong:
def __init__(self):
self.num=0
def getNumber(self):
self.num=int(input("Enter the number:"))
def checkNumber(self):
n=self.num
mod=0
s=0
while n>0:
mod=n%10
s=s+(mod*m... | true |
ae546e105853163ff1287d0ac57f364b6052407c | tapanprakasht/Simple-Python-Programs | /Calc.py | 1,134 | 4.21875 | 4 | #!/usr/bin/python3
# Simple calculator program in Python
class Calc:
def __init__(self):
self.num1=0
self.num2=0
def getNumber(self):
self.num1=int(input("Enter the first number:"))
self.num2=int(input("Enter the second number:"))
def showMenu(self):
print("\nSimple Calculator\n1.Add\n2.... | false |
70b93e79428b23c6689a33ed1e295ee3562395b5 | allualexander333/Python-Workshop | /BB-Level1-Assignment.py | 993 | 4.28125 | 4 | #!/usr/bin/env python
#Print the current date and time at the start of the program (hint: use the datetime library and search the internet)
import datetime
now = datetime.datetime.now()
print ("Current date and time using str method of datetime object : ")
print (now)
#Print out all the even numbers from the below... | true |
984eb23b3b158cc488aecdbaea5c7982e20bffb1 | Vickykathe/ejerciciosPython | /1 Generalidades inicio Python.py | 1,973 | 4.46875 | 4 | # Comentarios de una sola linea
""" comentarios multi linea
con triple comilla doble
al principio y final """
''' comentarios multi linea
con triple comilla doble
al principio y final '''
# una funcion es un subprograma que realiza una accion especifica ... nombreFuncion(informacionRequerida)
# print() ... es la ... | false |
01a0a97d8baf150e6e2a7d587192440ee134760d | sageetemple/Templeton_Sage | /Py.Lesson04/average_global.py | 344 | 4.15625 | 4 | num1=float(input("What is your first number: "))
num2=float(input("What is your second number: "))
num3=float(input("What is your third number: "))
avg=0
def average():
global avg
avg =(num1+num2+num3)/3
def display():
print("The average of", num1, ",", num2, ", and", num3, "is", "{:00.5f}".format(avg))
a... | true |
86b10245d0bec09d06900d1a6cbfc5ae0ad734ef | psavery/python-ci-test | /python_ci_test/dot_product.py | 488 | 4.28125 | 4 | #!/usr/bin/env python3
"""
Calculate the dot product of two lists.
"""
def dot_product(list_a, list_b):
"""
Calculate the dot product of two lists.
Args:
list_a: the first list
list_b: the second list
Returns: The dot product of the two lists.
"""
if len(list_a) != len(list_... | true |
342893be942041b1bc3a7a15ee61fbcb154c1a5d | rkechols/Advent2020 | /day23/cup_game.py | 2,545 | 4.15625 | 4 | import time
from typing import Dict, Tuple
STARTING_CUP_ORDER = "916438275"
SECTION_SIZE = 3
BIGGEST_CUP_NUMBER = 1000000
MOVE_COUNT = 10000000
def get_starting_cup_dict(big: bool) -> Tuple[Dict[int, int], int, int, int]:
cups_list = [int(label) for label in STARTING_CUP_ORDER]
biggest = max(cups_list)
if big:
... | true |
16b799364af10c38349da2505583deef599a0e14 | Chenkehan21/Learn-Python-with-Crossin | /小组作业三.py | 486 | 4.15625 | 4 | # 字符串拼接
# 通过 % 将 name, age, code 拼接成一句话
# 输出 Crossin is 18, he writes Python.
name = 'Crossin'
age = 18
code = 'Python'
print("%s is %d, he writes %s" % (name, age, code))
# 类型转换
num1 = '3.3'
num2 = 2.5
num1 = float(num1)
print(num1 + num2)
# bool
print(bool(-123))
print(bool(0)) # pay attention!
pri... | false |
04a646303d7f530ef9f49333b6a3c777c36d3b8a | joseeden/notes-cbt-nuggets-devasc | /Notes_0-9/4-Observer.py | 1,652 | 4.21875 | 4 |
#******************************************************************************************************************#
# 4-Observer.py
#******************************************************************************************************************#
# 2021-01-04 05:43:06
# This is the code used in '2-Understanding... | true |
a920371734dc8a37ddb9632212616fcd5049cb95 | Oliveira-Renato/ThinkPythonExercices | /ch01/exer1.py | 824 | 4.3125 | 4 | #1. In a print statement, what happens if you leave out one of the parentheses, or both?
#print('Hello, World!'
#R:SyntaxError: invalid syntax
#2. If you are trying to print a string, what happens if you leave out one of the quotation marks,or both?
#print('Here we go)
#R: EOL while scanning string literal
#3. You ... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.