blob_id string | repo_name string | path string | length_bytes int64 | score float64 | int_score int64 | text string | is_english bool |
|---|---|---|---|---|---|---|---|
304bcfdd829e991fa16a7599acec6069ea4ce02b | alicexue/softdev-hw | /hw07/closure.py | 1,063 | 4.65625 | 5 | # CLOSURES
# 1. A function is declared inside another function
# 2. Inner function accesses a variable from the outer function (outside of the local scope of the inner function)
# 3. The external function binds a value to the variable and finishes (or closes) before the inner function can be completed
def repeat(s):
... | true |
53480cb6f015a3aceab2b74efad30017109bef7b | dexamusx/thPyCh3 | /thPyCh3.py | 2,494 | 4.46875 | 4 | #Exercise 1
#Write a function named right_justify that takes a string named s as a parameter and prints the string
#with enough leading spaces so that the last letter of the string is in column 70 of the display.
#eg: right_justify('monty')
#monty
#Hint: Use string concatenation and repetition. Also, Python provid... | true |
739da86c8ad51a05972c4e0e9efe317f399226d2 | WritingPanda/python_problems | /anagramAlgorithm.py | 942 | 4.21875 | 4 | __author__ = 'Omar Quimbaya'
word_one = input("Enter the first word: ")
word_two = input("Enter the second word: ")
def is_anagram(string_one, string_two):
stripped_string_one = string_one.strip()
stripped_string_two = string_two.strip()
if not stripped_string_one.isalpha() and not stripped_string_two.i... | true |
d27f132a7cc830ccc6ef012bac020f9fa97a8315 | amitrajitbose/algo-workshop-lhd19 | /recursion/fibonacci.py | 275 | 4.28125 | 4 | def Fibonacci(n):
"""
Returns the nth term of the Fibonacci Sequence
n is zero based indexed
"""
if n < 0:
raise Exception("Invalid Argument")
elif n < 2:
return n
else:
return Fibonacci(n-1) + Fibonacci(n-2)
print(Fibonacci(0))
print(Fibonacci(3)) | false |
20318d3eb76e871efcaee27efd60bff76ca48823 | nirbhaysinghnarang/CU_Boulder_DSA | /merge_sort.py | 826 | 4.125 | 4 | def merge_sort(array,left,right):
if(left<right):
mid = (left+right)//2
merge_sort(array,left,mid)
merge_sort(array,mid+1,right)
merge(array,left,right,mid)
def merge(array,left,right,mid):
tmp = [0] * (right - left + 1)
left_ctr = left
right_ctr = mid+1
tmp_index=0
while(left_ctr<=mid and right_ctr<=ri... | true |
8e3126742c0512d221a20be687f742b7f3fdd5a2 | Degelzhao/python | /python_basic/if_prt.py | 343 | 4.1875 | 4 | height = input('please input your height:')
weight = input('please input your weight:')
BMI = float(weight)/pow(float(height),2)
if BMI < 18.5:
print('่ฟ่ฝป')
elif BMI >= 18.5 and BMI < 25:
print('ๆญฃๅธธ')
elif BMI >= 25 and BMI < 28:
print('่ฟ้')
elif BMI >= 28 and BMI < 32:
print('่ฅ่')
else:
print('ไธฅ้่ฅ่') | false |
986f484385ff4e75b25a0e6dbc6cec37c82486d9 | Degelzhao/python | /python_basic/if.py | 457 | 4.375 | 4 | age = 17
if age >= 18:
print('your age is',age)
print('your age is %d'%age)
print('adult')
else:
print('your age is %d'%age)
print('teenager')
#you should pay attention to add the colon(:) to
#the behind of IF and else
age = 3
if age >= 18:
print('adult')
elif age >= 6:
print('teenager')
else:... | false |
abed9991559fd5066191f3a64e457761148f4a42 | lisawei/director_to_python | /string.py | 375 | 4.15625 | 4 | name=raw_input("what's your name")
quest=raw_input("what's you quest")
color=raw_input("what is you favorite color")
print "Ah, so your name is %s, your quest is %s, your favorite color is %s." % (name,quest,color)
my_string="wow, you\'re great"
my_age="your age is"
age=18
print len(my_string)
print my_string.upper()... | true |
d60e3487cec11c3dac203a55fc9e528ec5c3518d | qzhn/linux_OM | /็ๆๅจ.py | 827 | 4.125 | 4 | #!usr/bin/env python
# coding=utf-8
import os
import sys
# !/usr/bin/python3
import sys
# ่ทๆฎ้ๅฝๆฐไธๅ็ๆฏ๏ผ็ๆๅจๆฏไธไธช่ฟๅ่ฟญไปฃๅจ็ๅฝๆฐ๏ผ
# ๅช่ฝ็จไบ่ฟญไปฃๆไฝ๏ผๆด็ฎๅ็น็่งฃ็ๆๅจๅฐฑๆฏไธไธช่ฟญไปฃๅจใ
# ๅจ่ฐ็จ็ๆๅจ่ฟ่ก็่ฟ็จไธญ๏ผ
# ๆฏๆฌก้ๅฐ yield ๆถๅฝๆฐไผๆๅๅนถไฟๅญๅฝๅๆๆ็่ฟ่กไฟกๆฏ๏ผ
# ่ฟๅyield็ๅผใ
# ๅนถๅจไธไธๆฌกๆง่ก next()ๆนๆณๆถไปๅฝๅไฝ็ฝฎ็ปง็ปญ่ฟ่กใ
def fibonacci(n): # ็ๆๅจๅฝๆฐ - ๆๆณข้ฃๅฅ
a, b, counter = 0, 1, 0
while True:
... | false |
96cb4ac82227897b2048fc37e969135c40960b2a | Umakant463/Mini_Projects | /Calculator/cal1.py | 1,110 | 4.21875 | 4 | import math
print ("========== SIMPLE CALCULATOR =========== \n \n ")
print ("--- Enter two numbers ---- \n ")
num1 = int(input('Enter first number : '))
num2 = int(input('Enter second number : '))
# Addition of numbers
def add(a,b):
return (a + b)
#First checks the largest among two numbers and then subtract t... | true |
2f69f87e503e3de98397c50726072bb3198bbe76 | bhabnish/Python-Project | /Project_My_Captain.py | 612 | 4.375 | 4 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# In this programme I took a radious from the user and found the area of the given radious
radius = int(input(" Please give the radius of your circle: "))
area = (22/7)*(radius)*(radius)
print ("The area of your circle is: " + str(area))
# In[3]:
# In this program... | true |
01347a7deaf574789eaa863881a070e9378cde9f | sylatupa/Pure_Data_Organelle_Patches_and_Mother | /PyPi_Midi_Box/src/Algorithms/fib-spiral2.py | 1,337 | 4.34375 | 4 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: sylatupa
#
# Created: 20/09/2015
# Copyright: (c) sylatupa 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------
import ... | false |
90a815d623eea0e183394bba7dc56925d73dd326 | EnginKosure/Jupyter_nb | /ch34.py | 2,634 | 4.25 | 4 | # For the sake of simplicity I'll refer to the array as "arr",
# the beginning index as "left", the end index as "right",
# and the element that we're searching for as "elem".
# The input for left and right initially will be left = 0 and right = sizeOfArray - 1.
# The rest of the algorithm can be broken down in five st... | true |
b08c72697fb4c9e7943f597cf01b07d2039aed34 | pasignature/holbertonschool-higher_level_programming | /0x07-python-test_driven_development/2-matrix_divided.py | 1,308 | 4.1875 | 4 | #!/usr/bin/python3
'''
2-matrix_divided.py
Contains function that divides all elements of a matrix
'''
def matrix_divided(matrix, div):
'''
Python Function that divide a matrix by variable div
'''
listError = 'matrix must be a matrix (list of lists) of integers/floats'
# Check if matri... | true |
4641f57df69aa565059f5c88006b63fd8ed5f8d4 | malmike/SelfLearningClinic | /Car/app/car.py | 2,046 | 4.28125 | 4 | class Car(object):
"""
Added constructor taking arguments *args and **kwargs where *args
expects a list of items and **kwargs expects a dictionary. This allows
a class to be initialised with dynamic number of variables
"""
def __init__(self, *args, **kwargs):
self.type = ''
... | true |
8b2cd66bf7b1723237dff6e99cb49d5b7cc29deb | ArutselvanManivannan/Hackerrank-Code-Repository | /Python/Classes/Dealing with Complex Numbers.py | 1,757 | 4.125 | 4 | # https://www.hackerrank.com/challenges/class-1-dealing-with-complex-numbers/problem
class Complex(object):
def __init__(self, real, imaginary):
self.real = real
self.imaginary = imaginary
def __add__(self, no):
r = self.real + no.real
i = self.imaginary + no.imaginary
... | false |
924fb3e750ab299c9dcd51a04d57d0efc1ca2ea4 | skaramicke/editpycast | /tools.py | 682 | 4.25 | 4 | def map_range(s: float, a: (float, float), b: (float, float)):
'''
Map a value from one range to another.
:param s: The source value, it should be a float.
:param a: The range where s exists
:param b: The range onto which we want to map s.
:return: The target value, s transformed from between a... | true |
4cbad57d3c6b0532d573f606b009abb19fbceb0d | BE-THE-BEST/Python_Study | /conditionalSentence.py | 2,973 | 4.1875 | 4 | # <if>
weather=input("์ค๋ ๋ ์จ๋ ์ด๋์?") # ์ฌ์ฉ์์ ์
๋ ฅ๊ฐ ๋ฐ๊ธฐ
if weather=="๋น" or "๋": # ์กฐ๊ฑด
print("์ฐ์ฐ์ ์ฑ๊ธฐ์ธ์") # ์คํ
elif weather=="๋ง์":
print("์ค๋น๋ฌผ์ด ํ์์์ด์")
else:
print("๋ ์จ๋ฅผ ๋ค์ ํ์ธํ์ธ์")
temp=int(input("์ค๋ ๊ธฐ์จ์ด ๋ช ๋์์?"))
if 30<=temp:
print("๋๋ฌด ๋์์")
elif 10<=temp and temp<30:
print("๋ ์จ๊ฐ ์ข์์")
elif 0<=temp and temp<1... | false |
67107dc72eb55a203ab779b52df685e5ec7c233b | predator1019/CTI110 | /P4HW1_BudgetAnalysis_alexvanhoof.py | 896 | 4.125 | 4 | # program that calculates the users budget expenses and if they went over it or not
# 9/18/18
# CTI-110 P4HW1 - Budget Analysis
# Alex VanHoof
#
userBudget = float(input("please enter how much you have budgeted "+ \
"for the month:"))
moreExpenses = 'y'
usertotalExpenses = 0
while mo... | true |
203b87d5cd8b1e6417bd4b7494b301417c59f387 | ShiekhRazia29/Extra_Questions | /Q8.py | 296 | 4.25 | 4 | #Q12 To check the given caracter is an Alphabet,digit or a special case
ch2 = input("Enter any character:")
if(ch2 >= 'A' or ch2 >='Z' or ch2 >='a' or ch2 >='z'):
print("This character is an ALPHABET")
elif (ch2 <=0 or ch2 >=9):
print("DIGIT")
else:
print("SPECIAL CHARACTER") | true |
2d3dd7d8b26f08e5292d4f29eab4a3dcb782f714 | eoinparkinson/basic-library-manager-compsci | /app.py | 2,452 | 4.375 | 4 | # importing libraries
import sys # using this to "END" the program, in theory it's not actually required.
print("Welcome to the coolboy library\nChoose one of three options:\n\n1. View all available books:\n2. Add a book:\n3. Search for a book:\nEND to end the program.\n\n") # opening spiel
# first choice, list ... | true |
bf6dc93b48cbad78a06b5470bbeb0cbf85532f40 | guangcity/learning-algorithm | /ๅ
ๅ/stack_queue/stack_1.py | 1,433 | 4.25 | 4 | class MyQueue:
def __init__(self):
"""
Initialize your data structure here.
"""
self.l1=[]
self.l2=[]
self.flag=True
def push(self, x):
"""
Push element x to the back of queue.
:type x: int
:rtype: void
"""
if not ... | false |
b1d014312d4b452c7057d4db132f3f8acc79ed3b | yamogi/Python_Exercises | /ch02/ch02_exercises/ch02_ex02.py | 491 | 4.28125 | 4 | # ch02_ex02.py
#
# Write a program that allows a user to enter his or her two favorite foods.
# The program should then print out the name of a new food by joining the
# original food names together.
#
print("Hi there!")
food_1=input("Please enter one of your favourite foods: ")
print("Great.")
food_2=input("Please en... | true |
06bb63a937f6c42d3fc60746f9327c42267c0b04 | sethips/python3tutorials | /lists.py | 1,687 | 4.6875 | 5 |
# ways to initiate a tuple
tupleExample = 5, 6, 2, 6
tupleExample1 = (5, 6, 7, 8)
print("Tuple ", tupleExample)
# accessing a tuple's element
print("Second element of tupleExample ", tupleExample[1])
# ways to create a list, use square brackets
listExample = [5, 2, 4, 1]
print("List:", listExample)
# accessing a L... | true |
81b7b3cfb37d991de284a855b3de084b3c74e7b0 | tommy-dk/projecteuler | /p12.py | 1,323 | 4.375 | 4 | #!/usr/bin/env python
from math import sqrt
def factors(n):
# 1 and n are automatically factors of n
fact=[1,n]
# starting at 2 as we have already dealt with 1
check=2
# calculate the square root of n and use this as the
# limit when checking if a number is divisible as
# fac... | true |
8303693c0075d541f530b714ba2dbc1ce7b57bf9 | CiscoDevNet/netprog_basics | /programming_fundamentals/python_part_1/example3.py | 1,884 | 4.59375 | 5 | #! /usr/bin/env python
"""
Learning Series: Network Programmability Basics
Module: Programming Fundamentals
Lesson: Python Part 1
Author: Hank Preston <hapresto@cisco.com>
example3.py
Illustrate the following concepts:
- Creating and using dictionaries
- Creating and using lists
- Working with for loops
- Conditional ... | true |
b47ee9b72263f1a4fd7a5090d73f8dd47771bcb8 | joebary/Challenge-Module-2-Columbia | /Module 2 assignments/Starter_Code/qualifier/qualifier/utils/fileio.py | 1,933 | 4.375 | 4 | # -*- coding: utf-8 -*-
"""Helper functions to load and save CSV data.
This contains a helper function for loading and saving CSV files.
"""
import csv
from pathlib import Path
import sys
def load_csv(csvpath):
"""Reads the CSV file from path provided.
Args:
csvpath (Path): The csv file path.
Re... | true |
62c0eb6baa5ce9f8127352ec4e158d8787c897dc | arjungoel/Real-Python | /str_repr_2_demo.py | 500 | 4.375 | 4 | # __str__ vs __repr__
# __str__ is mainly used for giving an easy-to-read representation of your class.
# __str__ is easy to read for human consumption.
# __repr__ is umambiguous and the goal here to be as explicit as possible about what this object is and more meant
# for internal use and something that would make thi... | true |
1c99cd2f5d91cb563decb8c8985a96d1acac5c84 | CHRISTIANCMARCOS/progAvanzada | /EJERCICIO29.py | 579 | 4.15625 | 4 | # Ejercicio 29
# Celsius a Fahrenheit y Kelvin
# Escriba un programa que comience leyendo la temperatura del usuario en grados
# Celsius. Entonces su programa debe mostrar la temperatura equivalente en grados
# Fahrenheit y grados Kelvin. Los cรกlculos necesarios para convertir entre diferentes
# unidades de te... | false |
0781530853346c102d97dc03a958b06f2743a2da | CHRISTIANCMARCOS/progAvanzada | /EJERCICIO81.py | 810 | 4.21875 | 4 | # Ejercicio 81
#
# Escribir una funcion que tome la longitud de los dos lados mas cortos de un triangulo rectangulo como argumentos.
# La funcion debe de regresar la hipotenusa del triangulo calculado utiliando el teorema de pitagoras como el resultado de la funcion.
# Incluya un programa principal que lea las ... | false |
217ce0434583b1cc99869a06e419f9f12a15e8f0 | knight-furry/Python-programming | /x-shape.py | 288 | 4.125 | 4 | num = input("Enter the odd digit number : ")
length = len(num)
if length % 2 != 0 :
for i in range(length):
for j in range(length):
if i==j or i+j==length-1 :
print (num[i],end=" ")
else:
print (" ",end=" ")
print ()
else:
print ("The number is NOT odd digit......!")
| true |
bdfe9405c236a02b47767da3d7cd5ccde339f1bb | knight-furry/Python-programming | /permit.py | 1,134 | 4.28125 | 4 | # Python 3 program to print all permutations with
# duplicates allowed using prev_permutation()
# Function to compute the previous permutation
def prevPermutation(str):
# Find index of the last element
# of the string
n = len(str) - 1
# Find largest index i such that
# str[i ? 1] > str[i]
i = n
whil... | true |
c2fa6cb63efe6e4d6ea38fa45e441fdb4af847cb | cvlg-dev/wy-til | /anything-python/advanced-python/chp03-02.py | 1,002 | 4.59375 | 5 | # ๋งค์ง๋งค์๋๋ฅผ ํตํ ๋ฒกํฐ ์ฐ์ฐ ์์
class Vector:
def __init__(self, *args):
"""
Create a vector, example: v = Vector(5, 10)
"""
if len(args) == 0:
self._x, self._y = 0, 0
else:
self._x, self._y = args
def __repr__(self):
"""
Return vector... | false |
ed07a08f36e349ec938df07c2eb02aeafa32a043 | abvillain22/python | /SubFun.py | 239 | 4.25 | 4 | import re
str1="hello, welcome in the world of python"
pattern1="hi"
pattern2="hello"
print((re.sub(pattern2,pattern1,str1)))
#the sub fun in the re module can be used to search a pattern in the string and replace it with another string
| true |
71d2238b97e5836cc4429dd62c194e2ec34e6566 | 3228689373/excercise_projecteuler | /sum_of_mul_of_3or5.py | 487 | 4.125 | 4 | def sum_of_mul_of_3or5(n=1000):
'''
https://projecteuler.net/problem=1
If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
'''
arr = list(ran... | true |
c5a59b325a2b01ffccab8ccb84affa2246d2c038 | DracoHawke/python-assignments | /Assignment4/Assignment4.py | 2,024 | 4.5625 | 5 | import copy as c
# Q.1 - Reverse the whole list using list methods.
# A.1 ->
num = int(input("Enter the number of elements\n"))
print("Enter the elements")
list1 = []
for i in range(0, num):
ele = int(input())
list1.append(ele)
print(list1)
print("Reversed list is: ")
list1.reverse()
print(list1)
# Q.2 - Pri... | true |
e755e47cc4c5d15ec9c3c0d0b2c9afa97c3baa62 | SebastianG343/LaboratorioFuncionesRemoto | /is_prime3.py | 580 | 4.1875 | 4 | def is_prime():
x=0
n=int(input("Digite un numero"))
try:
while n!=0 and n>0:
n=int(input("Digite un numero"))
if n%n==0 and n%1==0:
if n==4:
print("Is NOT a prime number")
if n>3 and n%2==0 or n%3==0 and n!=4:
... | false |
069dc38c40f3a0223c8dd650c65a60ce172601e2 | HenrryHernandez/Python-Projects | /DataStructuresUdacity/Trees/tree order/binaryTree.py | 1,853 | 4.15625 | 4 | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree:
def __init__(self, root):
self.root = root
self.nodes = ""
def search(self, find_val):
"""Return True if the value
is in the tree, return
... | true |
6c09b38d0502bdedee9dc1c42c890511f9d3a79f | RizkiAsmoro/python | /File-Handling/File_handling.py | 1,136 | 4.4375 | 4 | '''
"w" - Write
"r" - Read
"a" - Append
"x" - Create
"r+"- write and read mode
'''
#write mode 'w' - Opens a file for writing,
#creates the file if it does not exist
file = open("data.txt","w")
file.write("This is data text, created by python")
file.write("\nthis is 2nd row data text")
file.write("\nthis is 3rd ... | true |
42d5c1f18bbe06f5db0f414ead1e6f2cb789fd56 | RizkiAsmoro/python | /For_loop2.py | 1,434 | 4.125 | 4 | '''
FOR,Else Loop
Continue, pass
'''
# print range number
print(20*"=","RANGE")
for i in range(0,5):
print(i)
print(20*"=","range increment")
for i in range (10,30,5): #range 10 to 30, increment 5
print(i)
# For Else
print(20*"=","FOR ELSE")
number = 3
for i in range (1,6):
print(i) # print range number ... | true |
4ffe624d4ca2a7fc52fbf496a87a5036688cb5e6 | chiayinf/MastermindGame | /count_bulls_and_cows.py | 2,291 | 4.34375 | 4 | '''
CS5001
Spring 2021
Chiayin Fan
Project: A python-turtule built mastermind game
'''
def count_bulls_and_cows(secret_code, guess):
'''
function: count_bulls_and_cows: count how many black and red pegs the player has
parameters: secret_code: 4 colors secret code list
guess: 4 ... | true |
0630bc008d61731144e41d2da5a473b929530d3d | guyrux/udacity_statistics | /Aula 25.29 - Extract First Names.py | 322 | 4.46875 | 4 | '''
Quiz: Extract First Names
Use a list comprehension to create a new list first_names containing just the first names in names in lowercase.
'''
names = ["Rick Sanchez", "Morty Smith", "Summer Smith", "Jerry Smith", "Beth Smith"]
first_names = [name.lower().split()[0] for name in names] # write your list comprehens... | true |
996dbf33c8f16d6f99d714c49c9039af0d8f4514 | Potokar1/Python_Review | /sorting_algorithms/quick_sort.py | 2,546 | 4.3125 | 4 | # Select a pivot, which we will use to split the list in half by comparing every other number to the pivot
# We will end up with a left partition and a right partition. Best splits list in half
# This can be better if there is less than a certain amount of values, then we can use selection sort
# Helps the user by ju... | true |
8fc9d5a8e60bcac345468ed59382ee1848061d2b | Potokar1/Python_Review | /data_structures/stack_divide_by_two.py | 896 | 4.40625 | 4 | '''
Use a stack data structure to convert integer values to binary
Example: 242 (I learned this in class!) (bottom up of remainder is bin of 242)
remainder
242 / 2 -> 0
141 / 2 -> 1
60 / 2 -> 0
30 / 2 -> 0
15 / 2 -> 1
7 / 2 -> 1
3 / 2 -> 1
1 / 2 -> 1
'''
from s... | true |
9b2f97a9a34750879cde3e23fb3219211e31638f | Jcarlos0828/py4eCourses-excercisesCode-solved | /Using Databases with Python/Week 2/countEmailWithDB.py | 1,382 | 4.3125 | 4 | #Code Author: Josรฉ Carlos del Castillo Estrada
#Excercise solved from the book "Python for Everybody" by Dr. Charles R. Severance
#Following the Coursera program "Using Databases with Python" by the University of Michigan
'''
Count the number of emails sent by each domain and order them in a DESC way.
The data extract... | true |
7ab6ac45fce569df75e799346005eb9b15f51277 | lucassilva-dev/codigo_Python | /ex041.py | 600 | 4.21875 | 4 | from datetime import date
ano = int(input('Qual o ano em que vocรช nasceu? '))
dataatual = date.today()
idade = dataatual.year-ano
if idade <= 9:
print('Vocรช tem {} anos, estรก na categoria MIRIM'.format(idade))
elif idade <= 14:
print('Vocรช tem {} anos, estรก na categoria INFANTIL'.format(idade))
elif ida... | false |
6542bb2afe9b53282b8276a06ef142874aaa8fb2 | marquesarthur/programming_problems | /leetcode/regex/mini_parser.py | 2,397 | 4.21875 | 4 | # """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
class NestedInteger(object):
def __init__(self, value=None):
"""
If value is not specified, initializes an empty list.
Otherwise initializes a single in... | true |
c4d0acf509af5620273ae604f23777776fc1baf9 | gcharade00/programs-hacktoberfest | /lenlist.py | 431 | 4.4375 | 4 | # Python code to demonstrate
# length of list
# using naive method
# Initializing list
test_list = [ 1, 4, 5, 7, 8 ]
# Printing test_list
print ("The list is : " + str(test_list))
# Finding length of list
# using loop
# Initializing counter
counter = 0
for i in test_list:
# incrementing counter
count... | true |
a8575326c07c78421ad1340f45c36b51958dc2a8 | drussell1974/a-level | /recursion/recursion_factorial.py | 437 | 4.28125 | 4 | def iterative_factorial(num):
factorial = 1
for x in range(1, num+1):
factorial = factorial * x
return factorial
def recursive_factorial(num):
if num < 2:
""" stop the recursion when num = 1 or less """
return 1
else:
""" recursive call """
return num * recur... | true |
9c37992199846681936822ba20f99e7178ace550 | SobrancelhaDoDragao/Exercicio-De-Programacao | /Exercicios-Python/Basico/Exercicios/exercicio25.py | 233 | 4.21875 | 4 | # Crie um programa que leia o nome de uma pessoa e diga se ela tem "SILVA" no nome.
nome = input("Digite um nome: ").upper()
if nome.find("SILVA") != -1:
print("O nome possui silva")
else:
print("O nome nรฃo possui silva")
| false |
caffd24184b954254165bfc744aa6eb0f48f50bc | SobrancelhaDoDragao/Exercicio-De-Programacao | /Exercicios-Python/Basico/Exercicios/exercicio41.py | 918 | 4.21875 | 4 | # A confederaรงรฃo Nacional de Nataรงรฃo precisa de um programa que leia o ano de nascimento
# de um atleta e mostre sua categoria, de acordo com a idade:
# Atรฉ 9 anos: MIRIM
# Atรฉ 14 anos: INFANTIL
# Atรฉ 19 anos: JUNIOR
# Atรฉ 20 anos: SรNIOR
# Acima: MASTER
from datetime import date
print('-'*20)
nascimento = int(input... | false |
e94ad71067de273a105041d9c8e516661fabc62c | SobrancelhaDoDragao/Exercicio-De-Programacao | /Exercicios-Python/Basico/Exercicios/mostrando_tipo.py | 663 | 4.25 | 4 | # -*- coding: utf-8 -*-
# Mostrando o tipo do valor recebido -----
#------------------------------------------------------------------
#------------------------------------------------------------------
# Indepedente do que for digitado o valor serรก um string
# Por isso รฉ necessรกrio formatar o ... | false |
8f208e7c3c0aec9b5264244d75e0969e9ac30cd5 | SobrancelhaDoDragao/Exercicio-De-Programacao | /Exercicios-Python/Basico/Exercicios/exercicio53.py | 510 | 4.15625 | 4 | # Crie um programa que leia uma frase qualquer e diga se ela รฉ um
# palรญdromo, desconsiderando os espaรงos
# EX:
# Apรณs a sopa
# A sacada da casa
# A torre da derrota
# O lobo ama o bolo
# Anotaram a data da maratona
frase = str(input("Digite uma frase: "))
inverso = frase[::-1]
if frase == inverso:
print("A fr... | false |
c171054c698c293d887a043f832cca3323fe3518 | abaah17/Programming1-examples | /w12s1_rps.py | 1,617 | 4.53125 | 5 | # This example will show case various ways to create a rock paper scissors program
# using functions from the random library
# More information here:
from random import *
# In this approach, we pick a random number between 1 and 3, then connect each number with a
# move in an if statement:
def taiwo_bot():
x = ran... | true |
73cb2e4ada1d9727b65198ef1f7152adeda5067a | abaah17/Programming1-examples | /w7s1_string_demo.py | 1,173 | 4.21875 | 4 | alu_quote = "take ownership"
# Indexing into Strings
print(alu_quote[10])
# Length of String: len returns how many characters are in a string
# Think of a character as the act of typing a key. Spaces and punctuation are characters too!
print(len(alu_quote))
# Strings are immutable
# The following line will trigger a... | true |
6064cd6b129e1896ffc803734bd2ec79bae75b65 | cauequeiroz/MITx-6.00.1x | /week2/is_in_recursive.py | 824 | 4.125 | 4 | def isIn(char, aStr):
'''
char: a single character
aStr: an alphabetized string
returns: True if char is in aStr; False otherwise
'''
if aStr == '':
return False
if len(aStr) == 1:
return aStr == char
middle_pos = int(len(aStr)/2)
if aStr[middle_pos] == char:... | false |
5a3b728b655f7f82c4aecf90ef8066e311119e69 | a55779147/Notes | /Python3/Fluent Python ็ซ ่ๆป็ป/chapter1/2.py | 957 | 4.3125 | 4 | # ๅฎ็ฐไธไธชๅ้็ฑปVector
# ไฝฟๅ
ถๅฎ็ฐ + - *
from math import hypot
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
x = self.x + other.x
y = self.y + other.y
return Vector(x, y)
def __sub__(self, other):
x = self.x - other.x
... | false |
aba6b636759d7bbd52f488da76d3307a72df5757 | perryriggs/Python | /mindstorms.py | 1,534 | 4.46875 | 4 | #mindstorms - from the book by the same name
import turtle
#define a function to draw a square
def draw_square(t):
x = 1
while x <= 4:
t.right(90)
t.forward(100)
x = x+1
# define a function to draw a circle
def draw_circle():
circ = turtle.Turtle()
circ.shape("arrow")
circ... | true |
d6674bf9af185d6ac97df47396f46ace4af3adef | dgranillo/Projects | /Classic Algorithms/sorting.py | 1,698 | 4.3125 | 4 | #!/usr/bin/env python2.7
"""
Sorting - Implement two types of sorting algorithms: Merge sort and bubble
sort.
Author: Dan Granillo <dan.granillo@gmail.com>
ToDo: Merge sort does not append remaining values from one half if the other's
counter has reached the limit. Generally 2nd half's last number is ommitted.... | true |
f1369ab1fe6a5f6648c5100bf7c92a0a2b0bc432 | obrunet/Apprendre-a-programmer-Python3 | /07.05.max_of_3num.py | 655 | 4.15625 | 4 | # Dรฉfinissez une fonction maximum(n1,n2,n3) qui renvoie le plus grand de 3 nombres n1, n2, n3 fournis en arguments.
# Par exemple, lโexรฉcution de lโinstruction : print(maximum(2,5,4)) doit donner le rรฉsultat : 5
def maximum (a, b, c):
max = a
if a < b:
max = b
if b < c:
max = c
... | false |
5b0473d6043a2e689d0d29719112b1754d37aa7d | obrunet/Apprendre-a-programmer-Python3 | /12.05.circle.py | 1,659 | 4.3125 | 4 | # Dรฉfinissez une classe Cercle(). Les objets construits ร partir de cette classe seront des cercles de tailles variรฉes.
# En plus de la mรฉthode constructeur (qui utilisera donc un paramรจtre rayon), vous dรฉfinirez une mรฉthode surface(), qui devra renvoyer la surface du cercle.
# Dรฉfinissez ensuite une classe Cylindr... | false |
4d8f3af5a231a15714a41d95a036839ebb420c5e | obrunet/Apprendre-a-programmer-Python3 | /06.12.sqrt__not_corrected__.py | 453 | 4.15625 | 4 | # Demander ร lโutilisateur quโil entre un nombre.
# Afficher ensuite : soit la racine carrรฉe de ce nombre,
# soit un message indiquant que la racine carrรฉe de ce nombre ne peut รชtre calculรฉe.
from math import sqrt
print("Enter a floating number", end=" ")
nb=float(input())
if nb<0:
print("The square ... | false |
a5336d2b84c265d219e64313929cb2a8370f7a9b | obrunet/Apprendre-a-programmer-Python3 | /10.32.longest_word_in_sentence___not_corrected___.py | 525 | 4.125 | 4 | # รcrivez un script qui recherche le mot le plus long dans une phrase donnรฉe
# (lโutilisateur du programme doit pouvoir entrer une phrase de son choix).
inputStr = input("Enter a long sentence with serveral words: ")
inputList = inputStr.split(" ")
# print(inputList)
longest_word, length = "", 0
for word in... | false |
f551c16169e31061b1f8c8b26f7dd56bd3b8b716 | obrunet/Apprendre-a-programmer-Python3 | /07.11.name_of_the_month.py | 579 | 4.125 | 4 | # Dรฉfinissez une fonction nomMois(n) qui renvoie le nom du n-iรจme mois de lโannรฉe.
# Par exemple, lโexรฉcution de lโinstruction :
# print(nomMois(4)) doit donner le rรฉsultat : Avril.
monthList = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Decem... | false |
175c0fad6f626e3c813cf55450b581f73b660267 | dimaalmasri/pythonCodes | /Functions/built-in-functions.py | 1,918 | 4.40625 | 4 | """
This file contains some examples for built-in functions in python
they are functions that do certain things
I will explain
"""
#example 1 = .upper()
#added by @basmalakamal
str1 = "hello world"
print str1.upper()
#this how we use it and it is used to return the string with capital letters
#example 2 = isupper(... | true |
c8081213be5dae1651f642dc605dbb868daa9570 | Flimars/Python3-for-beginner | /_listas_execicios/list1_ex1.py | 335 | 4.3125 | 4 | # 1. Desenvolva o algoritmo de um programa onde o usuรกrio irรก informar um nรบmero
# inteiro e o programa deve calcular e exibir o nรบmero imediatamente antecessor ao
# nรบmero digitado pelo usuรกrio.
num = int(input('Digite um nรบmero inteiro: '))
antecessor = num - 1
print('O antecessor do seu nรบmero รฉ {}:'.format(anteces... | false |
7f8c90512749b9861743a98aba866debc7cb9f03 | Flimars/Python3-for-beginner | /_listas_execicios/list1_ex6.py | 265 | 4.1875 | 4 | # 6. Desenvolva o algoritmo de um programa para calcular a mรฉdia de duas notas das
# avaliaรงรตes de um aluno.
nota_1 = float(input('Digite a 1ยบ nota: '))
nota_2 = float(input('Digite a 2ยบ nota: '))
media = (nota_1 + nota_2)/2
print('A nota mรฉdia รฉ = ',media) | false |
c9777249c747b0ce1a86cae1147dbc479b802ae3 | ialtikat/gaih-students-repo-example | /Final Project/FinalProje.py | 2,308 | 4.15625 | 4 | class Food:
def __init__(self,name):
self.name=name
def pisir(self, name):
if self.name == "Kavurma":
print("Piลmesi iรงin 75 DK bekleyelim")
elif self.name=="Pilav":
print("Piลmesi iรงin 40 DK bekleyelim")
def karistir(self):
print(... | false |
b45fcda91797777b337cf5e426cf5d225413662d | pythonshiva/Pandas-Ex | /Lesson5/lesson5.py | 485 | 4.53125 | 5 | #Stacking and unstacking functions
import pandas as pd
#Our small dataset
d = {'one':[1,1], 'two': [2,2]}
i = ['a', 'b']
#Form DataFrame
df = pd.DataFrame(data= d, index=i)
# print(df)
#Bring the column and place them in the index
stack = df.stack()
print(stack)
#now it became the multi level index
# print(stack.ind... | true |
1cec851dea3b5601b95b3fd71cdd669f974b94c4 | khanshoab/BASIC-OF-HTML | /python project/exp201.py | 457 | 4.15625 | 4 | ''' 2.1 wrote a python program to implement the loop
@ author khan shoab akhtar vbakil ahmad khan
'''
# factorial using loop
num=int(input('enter the number :'))
fact=1
for i in range(1,num+1):
fact=fact*i
print('factorial of ',num,'is',factpy)
# fibonacci using while loop
num=int(input('entre the number:'))
a=0... | false |
21bec91a2b0ba523b2d99b1ed30d43a934709f91 | bc-maia/udacity_python_language | /A - Basics/10 - LambdaFilter.py | 808 | 4.40625 | 4 | # Quiz: Lambda with Filter
# filter() is a higher-order built-in function that takes a function
# and iterable as inputs and returns an iterator with the elements
# from the iterable for which the function returns True. The code
# below uses filter() to get the names in cities that are fewer than
# 10 characters long t... | true |
2526043e6fdc0407bb5746c00b1ca6b9c134e118 | prowrestler215/python-2020-09-28 | /week1/day2/afternoon/for_loop_basic_II.py | 1,097 | 4.15625 | 4 | # Ultimate Analysis - Create a function that takes a list and returns a dictionary that has the sumTotal, average, minimum, maximum and length of the list.
# Example: ultimate_analysis([37,2,1,-9]) should return {'sumTotal': 31, 'average': 7.75, 'minimum': -9, 'maximum': 37, 'length': 4 }
def ultimate_analysis(list_pa... | true |
6973aa76eff67755325892efe399c0454b22145b | danny237/Python-Assignment2 | /palindrome.py | 883 | 4.21875 | 4 | """ Program to check the given word is palindrome or not """
# check using reverse method
# def is_palindrome(str1):
# reverse_string = list(reversed(str1))
# if list(str1) == reverse_string:
# return True
# else:
# return False
def is_palindrome(str1):
"""
Function to check palin... | true |
ea7b1c878e51f549714901af7cda5cea24a4b5a3 | danny237/Python-Assignment2 | /valid_string_paren.py | 803 | 4.46875 | 4 | """Program to valid a string of parenthese."""
class Parenthese:
"""
Class for validating parenthese
Attribute:
str1(string): given parentheses
"""
def __init__(self, str1):
self.str1 = str1
def is_valid(self):
"""function that return True if valid parenthese"""
... | true |
7583c18f0bae28b4e05b3e677d30f1a295da24d6 | HenrikSamuelsson/exercism-python-track | /python/pangram/pangram.py | 859 | 4.15625 | 4 | import string
def is_pangram(sentence):
"""Check if all the characters in the alphabet (a - z) is used in a given sentence."""
# Convert the input to all lower case letters.
lower_case_sentence = sentence.lower()
# Get a list of all the ASCII lower case letters i.e. a-z.
all_lower_case_ascii_lett... | true |
c220c282db5e1453430dbcfd7843b1f8cebfc04e | morrisunix/python | /projects/list_overlap.py | 1,245 | 4.125 | 4 | from random import randint
def get_intersection(list_1, list_2):
""" Returns a new list with the intersecion of both lists
Parameters
----------
list_1: list
First given list
listd_2: list
Second given list
Returns
-------
list
The intersection list
"""
... | true |
48089f24a5b66de04df58c61d050b74171f986cc | Favi0/python-scripts | /MIT/ps1/ps1b.py | 834 | 4.3125 | 4 | portion_down_payment = 0.25
current_savings = 0
investment_return = 0.04
months = 0
annual_salary = float(input("Enter your annual salary:โ "))
portion_saved = float(input("Enter the percent of your salary to save, as a decimal:โ "))
total_cost = float(input("Enter the cost of your dream home:โโ "))
semi_annual_raise ... | true |
58651ca614673607d7f6af83fd7c547f119a6d3a | srmcnutt/100DaysOfCode | /d8-caesar_cipher/main.py | 1,183 | 4.125 | 4 | # 100 days of code day 8 - Steven McNutt 2021
from resources import logo, alphabet
print(logo)
#super awesome ceasar cipher function w00t!
def caesar(text="foo", shift=0, direction = "e"):
transformed_text = ""
cipher_direction = "encode"
if direction[:1] == 'd':
cipher_direction = "decode"
shif... | true |
bf526aa21e5c7eada8c6bdd5cda629989211104e | aparnabreddy/python-assignment-1 | /list_1.py | 328 | 4.25 | 4 | cities=["Bangalore","Hyderabad","Delhi","Mangalore"]
towns=["pavagada","chitradurga"]
print(cities) #printing list elements
print(cities+towns) #merging two lists
print(len(cities)) #finding length of list
print(len(cities+towns))
cities.remove('Mangalore') #removinh element from list
print(cities)
cities.pop(2)
print(... | false |
3760de65a11afb88923d8a409d9973994d94dccb | VishalGohelishere/Python-tutorials-1 | /programs/Conditionals.py | 243 | 4.25 | 4 | x=5
if x==5 :
print("Equals 5")
if x>4 :
print("Greater then 4")
if x>=5:
print("Greater then or equal to 5")
if x<6:
print("Less then 6")
if x<=5:
print("Less then or equal to 5")
if x!=6 :
print("Not equal to 6")
| true |
6527fd5b804fbaba356c9244a5def3a96038143d | faizerhussain/TestingEclipseGitUpload | /Hello1/conditional.py | 270 | 4.125 | 4 | x=3
if x<4:
print(True)
if x<5:
print('yes')
else:
print('no')
color='red'
if color=='red':
print('color red')
elif color=='blue':
print('color blue')
if color=='red' and x<5:
print('color red number 5')
| false |
34bd49ebdd08097ee10ab002bdb93ce558efc45c | MariusArhaug/RPNCalculator | /container.py | 812 | 4.21875 | 4 | """Container superclass"""
from abc import ABC, abstractmethod
class Container(ABC):
"""
Super class for Queue and Stack
"""
def __init__(self):
self._items = []
def size(self):
"""
Get number of items
:return: int number of items
"""
return len(se... | true |
0ecc7fff80aba73ccf12bee5907d190ffcc200bc | Praveenstein/Intern_Assignment | /autocorrelation_for_all_lags.py | 1,482 | 4.59375 | 5 | # -*- coding: utf-8 -*-
""" Computing autocorrelation for a given signal
This script allows the user to compute the autocorrelation value
of a given signal for lags = 1, 2, 3.....N-2, where N is the length
of the signal
This file contains the following function:
* main - the main function of the script
... | true |
c2c3eb6e0230082565cd461d481464aaede738af | mt-digital/flask-example | /files_example.py | 957 | 4.3125 | 4 | '''
Run this like so:
python example.py
It will create a directory 'files_dir' if it
doesn't exist then put a new random text file in there.
The file name before ".txt" will be one greater
for each new file added to the files directory.
'''
import os
dirname = 'files_dir'
# Check if directory exists.
if not os.... | true |
b7ca9d69fe171766db59c39d846109d2b37659af | Faybeee/Session-2-homework | /session 2 task 3 homework.py | 1,599 | 4.375 | 4 | #Write a program which will ask for two numbers from a user.
#Then offer a menu to the user giving them a choice of maths operators.
#Once the user has selected which operator they wish to use,
# perform the calculation by using a procedure and passing parameters.
def procedure_a(first,second):
print(first +... | true |
6c5d690754798e80ef8d8a261700cca7eeb472ee | HamplusTech/PythonCodes2021Update | /AnswersToTask - Week 1 Task 1.py | 1,629 | 4.46875 | 4 | print("Answers to online task by Hampo, JohnPaul A.C.")
print()
print("Week 1 Answers")
print("Answer to last week's task No.1\
Hello Dear! Here is a little task for us in python.\
\
1] Write a program to find the sum of the data structure below\
[[1,2,3],[4,5,6,7],[8,9]]\
\
2] Write a program to convert... | true |
1aee7f38b51816f3cb4361cac64668722f39fbd9 | HamplusTech/PythonCodes2021Update | /AnswersToTask - Week 1 Task 2.py | 1,794 | 4.625 | 5 | print("Answers to online task by Hampo, JohnPaul A.C.")
print()
print("Week 1 Answers - Task 2")
print("Answer to last week's task No.1\
Hello Dear! Here is a little weekend task for us in python.\
Consider the data structure below:\
menu = {'meal_1': 'Spaghetti',\
'meal_2': 'Fries',\
'meal_3': 'Cheeseb... | true |
49a439f7914640a0ed185871ec8d2d6b2ddc90db | HamplusTech/PythonCodes2021Update | /tryExcept.py | 336 | 4.5 | 4 | numCar = input("Please enter how many cars do you have\n")
try:
numCar = int(numCar)
if numCar.__neg__():
print("You have entered a negative number")
elif numCar >= 3:
print("You have many cars")
else:
print ("You have not many cars")
except:
print("You haven't ente... | true |
0d4eb88906b569b5553d84f3f024665d6e0af0e3 | HamplusTech/PythonCodes2021Update | /breakContinuePass.py | 1,062 | 4.3125 | 4 | # using BREAK, CONTINUE and PASS statements
print ("To end this script type 'end' not 'END'. Enjoy!")
count = 0
while True:
name = input("Please enter your name\n")
print("You type ", name)
if name == "end":
break
elif name == "END":
pass
elif name:
count += 1
... | true |
6d8977dcce04e80570fb94408e5dc50dc9dd1410 | joshuajz/grade12 | /1.functions/Assignment 1.py | 1,921 | 4.4375 | 4 | # Author: Josh Cowan
# Date: October 8, 2020
# Filename: Assignment #1.py
# Descirption: Assignment 1: Function Based Calculator
def calc():
# Asks for the first number (error checking)
try:
num1 = int(input("Number 1: "))
except ValueError:
print("Invalid Input -> Provide a num... | true |
8c3e3680b1bfb94e79a23d72d45494f9134b5f33 | joshuajz/grade12 | /0.review/5. multiply.py | 1,065 | 4.28125 | 4 | # Author: Josh Cowan
# Date: October 5, 2020
# Filename: multiply.py
# Descirption: Assignment 5: Multipcation Table
# Stores the actual table
table = []
# The row value (top value)
row = 1
# Iterates from 1 to 12
for i in range(1, 13, 1):
# a row value stored in a list
l = []
# The column... | true |
61f7c080d17f91319a6c2c2b15ab9b49ff497cdd | joshuajz/grade12 | /0.review/058.py | 291 | 4.25 | 4 | for z in range(3):
for i in range(9):
print("#", end="")
print("")
for i in range(4):
for g in range(5):
print("|", end=" ")
print("")
# You could do this in 2 but it would be more manual ie. print("#########") and print("| | | | |") | false |
941047f4b1bb82e4588fab7d6a80794cf56d7bc2 | joshuajz/grade12 | /1.functions/Assignment 3b.py | 1,160 | 4.1875 | 4 | # Author: Josh Cowan
# Date: October 8, 2020
# Filename: Assignment #3b.py
# Descirption: Assignment 3: Hypotenuse
import math
# Hypoten^2use function a^2 + b^2 = c
def pyth(a, b):
ab = (a * a) + (b * b)
return math.sqrt(ab)
# Function to ask the user for an integer
def get_int(dialog):
w... | true |
1f267aa4fd9ba74fe06b23c83cb5e69b0c0810fd | coxd6953/cti110 | /P2HW2_MealTip_DamienCox.py | 558 | 4.15625 | 4 | # Meal Tip Calculator
# 3/3/19
# CTI-110 P2HW2 - Meal Tip Calculator
# Damien Cox
#
#Enter the cost of the meal.
cost = int(input('Enter the total cost of the meal: '))
#Calculate the amount of the following tip percentages: 15%, 18% and %20.
fifteen = .15 * cost
eighteen = .18 * cost
twenty = .20 * cost
... | true |
e68db92bb6ef2bb9c140beec9394dd26d53df5a9 | SardulDhyani/MCA3_lab_practicals | /MCA3HLD/20712004_Garima Bisht/Answers_Codes/Ques11_Dictionaries.py | 322 | 4.15625 | 4 |
test_str = 'She is Good Girl'
print("The original string is : " + str(test_str))
lookp_dict = {"Good" : "very good", "Girl" : "She is also Beautiful"}
temp = test_str.split()
res = []
for wrd in temp:
res.append(lookp_dict.get(wrd, wrd))
res = ' '.join(res)
print("Replaced Strings : " + str(res... | true |
67cca33a6f7d91f8d5e596a2740c8a1e2887878b | SardulDhyani/MCA3_lab_practicals | /MCA3C/Saurabh_Suman_Section_C/ques_7.py | 360 | 4.28125 | 4 | #Write a program to demonstrate the use of the else clause.
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
if num1 > num2:
print("largest number is : ", num1)
else:
print("largest number is : ", num2)
#output:
#Enter the first number: 8
#Enter the sec... | true |
107f47f702084bd146b462fd8ffc2a5d0abe7e8e | b20bharath/Python-specialization | /Python-fundamentals/indefinite loop.py | 817 | 4.1875 | 4 | # Program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number
largest = 0
... | true |
2305c87b9c7128b1c75bee43208a10e793fef79f | hansamalhotra/learn-python-the-hard-way | /ex33 study drills 5.py | 343 | 4.125 | 4 | #Now changing while loop to for loop
#Do not need the i += increment part anymore
numbers = []
def make_a_list(last, increment):
for i in range(0,last, increment):
numbers.append(i)
last = int(input("Enter the last number ")) + 1
inc = int(input("Enter the increment "))
make_a_list(last, inc)
print(... | true |
2f8f05e85e4d9ebf73673bd5622bdf2befc146da | JoseAcevo/Python_Course_2020 | /trabajo_tuplas.py | 1,728 | 4.4375 | 4 | #ยฟQue son las tuplas en python?
#Son "listas", inmutables..
#misdatos=("jose",3,8,1979) # Creaciรณn de una tupla
#misdatoslista=list(misdatos) ... | false |
433c2beeb9a7ec415713a2204b881d1f482d8490 | jerrywu65/Leetcode_python | /problemset/007 Reverse Integer.py | 2,156 | 4.21875 | 4 | '''
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [โ231, 231 โ 1]. For the pu... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.