blob_id string | repo_name string | path string | length_bytes int64 | score float64 | int_score int64 | text string | is_english bool |
|---|---|---|---|---|---|---|---|
8b2aadc3171527ad7c2880ee3d5167cd0542ba85 | edu-athensoft/ceit4101python | /stem1400_modules/module_4_function/func1_define/function_3.py | 392 | 4.15625 | 4 | """
function
- without returned value
- with returned value
"""
def showmenu():
print("egg")
print("chicken")
print("fries")
print("coke")
print("dessert")
return "OK"
# call it and lost returned value
showmenu()
print()
print(showmenu())
print()
# call it and keep returned value
isdone = s... | true |
7a13ea84858a0824e09630477fe3861eb26571ae | edu-athensoft/ceit4101python | /stem1400_modules/module_12_oop/oop_06_instance/s5_add_attribute/instance_attribute_2.py | 593 | 4.46875 | 4 | """
Adding attributes to an object
"""
# defining a class
class Cat:
def __init__(self, name, age):
self.name = name
self.age = age
# self.color does not exist.
def sleep(self):
print('sleep() is called')
def eat(self):
print('eat() is called')
# def antimeth... | true |
420933e86e4ecad7a1108f09fcbf2531af0ee7df | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_6_dictionary/dictionary_func_03_len.py | 1,458 | 4.125 | 4 | # len()
# How len() works with tuples, lists and range?
testList = []
print(testList, 'length is', len(testList))
testList = [1, 2, 3]
print(testList, 'length is', len(testList))
testTuple = (1, 2, 3)
print(testTuple, 'length is', len(testTuple))
testRange = range(1, 10)
print('Length of', testRange, 'is', len(test... | true |
abf7b2cfe1d7d7c171855ca4dad7e57f6fd6943d | edu-athensoft/ceit4101python | /evaluate/evaluate_3_project/python1_beginner/guessing_number/guessing_number_v1.py | 1,689 | 4.25 | 4 | """
Guessing number version 1.0
problems:
1. how to generate a random number/integer within a given range
2. how to validate the number and make it within your upper and lower bound
3. comparing your current number with the answer
case #1: too small
case #2: too big
case #3: bingo
4. max 5 times
failed... | true |
5378ef0faa41bacd228ee02bc616d4fc74fd8bfb | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_6_dictionary/dictionary_func_04_sorted.py | 1,380 | 4.375 | 4 | # sorted()
# sorted(iterable[, key][, reverse])
# sorted() Parameters
# sorted() takes two three parameters:
#
# iterable - sequence (string, tuple, list) or collection (set, dictionary, frozen set) or any iterator
# reverse (Optional) - If true, the sorted list is reversed (or sorted in Descending order)
# key (Opti... | true |
4fbf6cc6d51892c9a80e5d4266be5ad184d5ff30 | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_7_array/array_3_search.py | 571 | 4.21875 | 4 | """
Searching element in a Array
"""
import array
# initializing array with array values
# initializes array with signed integers
arr = array.array('i', [1, 2, 3, 1, 2, 5])
# printing original array
print("The new created array is : ", end="")
for i in range(0, 6):
print(arr[i], end=" ")
print("\r")
# using in... | true |
c1fe6f37a7e4522a78a2e1d2922bdb6102636941 | edu-athensoft/ceit4101python | /stem1400_modules/module_10_gui/s04_widgets/s0401_label/label_7_justify.py | 1,117 | 4.1875 | 4 | """
Tkinter
place a label widget
justify=left|center(default)|right
"""
from tkinter import *
root = Tk()
root.title('Python GUI - Label justify')
root.geometry("{}x{}+200+240".format(640, 480))
root.configure(bg='#ddddff')
# create a label widget
label1 = Label(root, text='Tkinter Label 1',
hei... | true |
845282c41034ea8dd5595f6d9f41bc9dff50bfee | edu-athensoft/ceit4101python | /stem1400_modules/module_9_datetime/s93_strptime/s3_strptime/datetime_17_strptime.py | 420 | 4.1875 | 4 | """
datetime module
Python format datetime
Python has strftime() and strptime() methods to handle this.
The strptime() method creates a datetime object
from a given string (representing date and time)
"""
from datetime import datetime
date_string = "21 June, 2018"
print("date_string =", date_string)
date_object =... | true |
7b97eec2bef56c7cdfc4577d5838ba2d7c1cd4b3 | edu-athensoft/ceit4101python | /stem1471_projects/p00_file_csv_processor_2/csv_append_row.py | 824 | 4.25 | 4 | """
csv processor
append a row
In this example, we first define the data that we want to
append to the CSV file, which is a list of values representing
a new row of data.
We then open the CSV file in append mode by specifying 'a'
as the file mode. This allows us to append data to the end of
the file rather than over... | true |
7708fabec7e64fa51646e485729c1384f5283b63 | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_4_string/string_2_accessing.py | 425 | 4.375 | 4 | """
string - accessing char
"""
str1 = 'athensoft inc'
print('str = ', str1)
# accessing char in a string by index
# first character
print('str[0] = ', str1[0])
# last character
print('str[-1] = ', str1[-1])
# slicing - substring
# slicing 2nd to 5th character
print('str[1:5] = ', str1[1:5])
# slicing 6th to 2... | false |
dfd2d8cedd22ab7f2bbba00f7013e3df8eb6bdd6 | edu-athensoft/ceit4101python | /evaluate/evaluate_1_exercise/m6_dictionary/ex_add_key_1.py | 279 | 4.15625 | 4 | """
module 6. datatype
chapter 6-6. dictionary
Question:
3. Write a program to add a key to a dictionary
Sample Dictionary : {0: 10, 1: 20}
Expected Result : {0: 10, 1: 20, 2: 30}
Hints:
"""
mydict = {'a': 10, 'b': 20}
print(mydict)
mydict['c'] = 30
print(mydict)
| false |
9ba6f0b0303c1287bfc28a289e4afe878b85cd34 | edu-athensoft/ceit4101python | /stem1400_modules/module_12_oop/oop_09_inheritance/s10_super/demo1_super_single/super_init_2c.py | 736 | 4.375 | 4 | """
super and init
child overrides init() of parent and use its own init()
child has its own property: age
parent has a property: name
child cannot inherit parent's property due to overriding,
properties defined in parent do not take effect to child.
"""
class Parent:
def __init__(self, name):
print('P... | true |
ba671e89c9244cd5969667d0f9aca6bec71a825d | edu-athensoft/ceit4101python | /stem1400_modules/module_12_oop/oop_09_inheritance/s10_super/demo1_super_single/super_init_2e.py | 672 | 4.21875 | 4 | """
super and init
child overrides init() of parent and use its own init()
child has its own property: age
parent has a property: name
child inherit parent's property by super(),
child init() must accept all parameters
the order of parameter matters
"""
class Parent:
def __init__(self, name):
print('P... | true |
aaba8ca8136fbb564b3c3a6869e57ec0be0b0fbf | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_4_string/string_demo/string_1_capitalize.py | 761 | 4.46875 | 4 | """
string method - capitalize()
string.capitalize()
return a new string
"""
# case 1. capitalize a sentence
str1 = "pyThOn is AWesome."
result = str1.capitalize()
print(f"old string: {str1}")
print(f"new string: {result}")
print()
# case 2. capitalize two sentence
str1 = "pyThOn is AWesome. pyThOn is AWesome."
... | true |
e8beb53f159933978745cec0d453798992e3c514 | edu-athensoft/ceit4101python | /stem1400_modules/module_12_oop/oop_11_classmember/s01_class_attribute/demo_4_add_property.py | 482 | 4.25 | 4 | """
adding properties by assignment
"""
class Tool:
count = 0
def __init__(self, name):
self.name = name
Tool.count += 1
# test
tool1 = Tool("hammer")
print(f'{tool1.count} tool(s) is(are) created.')
print()
tool1.count = 99
print(f'The instance tool1 has extra property: count')
print(f'{t... | true |
c958faae61b8d8a3f1a85cba789bbf87d87a1388 | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_7_array/array_2_add_2.py | 347 | 4.34375 | 4 | """
Python array
Adding Elements to a Array
append()
extend()
source:
"""
import array as arr
numbers = arr.array('i', [1, 2, 3])
numbers.append(4)
print(numbers) # Output: array('i', [1, 2, 3, 4])
# extend() appends iterable to the end of the array
numbers.extend([5, 6, 7])
print(numbers) # Output: array('... | true |
4a5ca15f00ebf97484032636a9bf7a10458bc914 | edu-athensoft/ceit4101python | /stem1400_modules/module_10_gui/s04_widgets/s0401_label/label_1_create.py | 342 | 4.3125 | 4 | """
Tkinter
place a label widget
Label(parent_object, options,...)
using pack() layout
ref: #1
"""
from tkinter import *
root = Tk()
root.title('Python GUI - Text Label')
root.geometry("{}x{}+200+240".format(640, 480))
# create a label widget
label1 = Label(root, text='Tkinter Label')
# show on screen
label1.pa... | true |
c62f384b9f938f4ff0fcc96d8aec20ac81af479e | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_7_array/array_2_add.py | 725 | 4.21875 | 4 | """
Python array
Adding Elements to a Array
typecodes = 'bBuhHiIlLqQfd'
souce: https://www.geeksforgeeks.org/python-arrays/
"""
import array as arr
a = arr.array('i', [1, 2, 3])
print("Array before insertion : ", end=" ")
for i in range(0, 3):
print(a[i], end=" ")
print()
# inserting array using
# insert() fu... | false |
13f90032c463121cc3494f8d168ae637ca43ebbb | edu-athensoft/ceit4101python | /stem1400_modules/module_6_datatype/m6_4_string/string_demo/string_11_isdecimal.py | 558 | 4.3125 | 4 | """
string method - isdecimal()
True - if all characters in the string are decimal characters.
False - if at least one character is not decimal character.
"""
str1 = "1234556"
print(str1.isdecimal())
str1 = "-1234556"
print(str1.isdecimal())
str1 = "123.4556"
print(str1.isdecimal())
str1 = "123abc"
print(str1.isde... | false |
efa832f38aeb306d6c721ba97ab39cc0746ff6c2 | edu-athensoft/ceit4101python | /stem1400_modules/module_3_flowcontrol/c2_for/forloop_5_nested.py | 946 | 4.25 | 4 | # print out a matrix
"""
out put like
11,12,13
21,22,23
31,32,33
(11,12,13)
(21,22,23)
(31,32,33)
matrix = ((11,12,13),(21,22,23),(31,32,33))
loop for each row
round 0: (11,12,13) -> row 0 -> matrix[0]
Loop for each column
round 0: 11 -> matrix[0][0]
round 1: 12 -> mat... | false |
4543ea3f1dc6e723d7dfc265b3fe856dc787f186 | edu-athensoft/ceit4101python | /stem1400_modules/module_14_regex/s3_re/regex_9_search.py | 266 | 4.1875 | 4 | """
regex
"""
import re
mystr = "Python is fun"
pattern = r'\APython'
# check if 'Python' is at the beginning
match = re.search(pattern, mystr)
print(match, type(match))
if match:
print("pattern found inside the string")
else:
print("pattern not found")
| true |
0d3f250ba8d881ab75e3f043e905ec3425424496 | edu-athensoft/ceit4101python | /evaluate/evaluate_2_quiz/stem1401_python1/quiz313/q6.py | 1,290 | 4.4375 | 4 | """
Quiz 313
q6
A computer game company is developing a 3A-level role-playing game.
The character you are controlling will receive equipment items of
different tiers while adventuring in the big world. The system will
display different background and text colors according to the level
of the item to distinguish them. ... | true |
92d6114c1a38dc82151a67729905a625ef3f18ff | Mart1nDimtrov/Math-Adventures-with-Python | /01. Drawing Polygons with the Turtle Module/triangle.py | 373 | 4.53125 | 5 | # exerCise 1-3: tri anD tri again
# Write a triangle()
# function that will draw a triangle of a given “side length.”
from turtle import *
# encapsulate with a function
def triangle(sidelength=100):
# use a for loop
for i in range(3):
forward(sidelength)
right(120)
# set speed and shape
shape... | true |
e8b911a5f1a2d7b8569d3636cc5bcc2b1d5382a1 | BH909303/py4e | /ex6_1.py | 490 | 4.1875 | 4 | '''
py4e, Chapter 6, Exercise 1: Write a while loop that starts at the last
character in the string and works its way backwards to the first character in
the string, printing each letter on a separate line, except backwards.
William Kerley, 21.02.20
'''
fruit = 'banana'
index = len(fruit)-1 #set... | true |
ceedc4cf9059a26d9544f553148abac5a5d39d2a | AccentsAMillion/Python | /Ten Real World Applications/Python Basics/Functions and Conditionals/PrintReturnFunction.py | 396 | 4.15625 | 4 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 30 09:28:25 2020
@author: Chris
"""
#To create functions in python it starts with def function():
# Division (/) Function calculating the sum of myList taking in 3 parameters
def mean(myList):
print("Function mean started!")
the_mean = sum(myList) / len(myList)
... | true |
cb12aca17df00ff174aa59c48f720b77c23e9026 | andrei-chirilov/ICS3U-assignment-05b-Python | /reverse.py | 406 | 4.1875 | 4 | #!/usr/bin/env python3
# Created by: Andrei Chirilov
# Created on: November 2019
# This program reverses a digit
import math
def main():
number = int(input("Enter a number: "))
result = ""
if number == 0:
print(0)
exit(0)
while number != 0:
result += str(number % 10)
... | true |
9ca29631af7bc11b2128efe122862904346a05ec | oscarmrt/holbertonschool-higher_level_programming | /0x01-python-if_else_loops_functions/8-uppercase.py | 241 | 4.28125 | 4 | #!/usr/bin/python3
def uppercase(str):
for characters in str:
if ord(characters) >= 97 and ord(characters) <= 122:
characters = chr(ord(characters) - 32)
print('{:s}'.format(characters), end='')
print('')
| true |
181a7912a6a44a3887ee28c1a1af3276c9ca1609 | learsixela/logicaDiurno | /Funciones.py | 1,913 | 4.21875 | 4 |
#funcion
def funcionSaludo():
mensaje()
print("Esta es un mensaje desde otra funcion")
def mensaje():
print("mensaje")
print("mensaje2")
print("mensaje3")
print("***********")
#llamado a la funcion
#mensaje()
#funcionSaludo()
#mensaje()
def funcionSuma():
numero3 = 3
numero4 = 4
... | false |
37614a1f4ece39402e14fd4c73725151f8968339 | learsixela/logicaDiurno | /20201013_arreglos3.py | 1,321 | 4.15625 | 4 | #key, o palabra clave
#Diccionarios
numeros = {
"uno": 1,
"doscientos":200,
"gato":1234,
}
print(numeros["uno"])
print(numeros["doscientos"])
print(numeros["gato"])
print()
#agregar contenido a numeros
#crear variable para diccionario numeros
print(numeros)
numeros["cuatro"] = 4
print(numeros["cuatro"])
... | false |
d03cc6651d511fefa6af2adea4aa722df253f99d | gauthamikuravi/Python_challenges | /Leetcode/shift_zeros.py | 1,106 | 4.21875 | 4 |
#######################################################
#Write a program to do the following:Given an array of random numbers, push all the zeros of a given array to the start of the array.
# The order of all other elements should be same.
#Example
#1: Input: {1, 2, 0, 4, 3, 0, 5, 0}
#Output: {0, 0, 0, 1, 2,... | true |
53a16f0432aa40c042ddb70f4bfc0b09a97227dc | sk1z0phr3n1k/Projects | /python projects/mbox.py | 1,483 | 4.15625 | 4 | # Author: Mark Griffiths
# Course: CSC 121
# Assignment: Lab: Lists (Part 2)
# Description: mbox module
# The mbox format is a standards-based email file format
# where many emails are put in a single file
def get_mbox_username(line):
"""
Get mbox email username
Parse username from the start of an email
... | true |
320fba2a5627ea67e99b54abfae6315115e5c74b | Jamieleb/python | /challenges/prime_checker.py | 685 | 4.34375 | 4 | import math
def is_prime(num):
'''
Checks if the number given as an argument is prime.
'''
#first checks that the number is not even, 1 or 0 (or negative).
if num < 2 or num > 2 and not num % 2:
return False
#checks if all odd numbers up to the sqrt of num are a factor of num
for x in range(3, int(math.sq... | true |
80ae08b7bf04d23b557a34f0dcd409c04b7e942a | 2ptO/code-garage | /icake/q26.py | 541 | 4.59375 | 5 | # Write a function to reverse a string in-place
# Python strings are immutable. So convert string
# into list of characters and join them back after
# reversing.
def reverse_text(text):
"""
Reverse a string in place
"""
if not text:
raise ValueError("Text is empty or None")
start = 0
... | true |
908b37ef23e23156396a33582721faa92f816ddc | Akshaypokley/PYCHAMP | /src/SetConcepts.py | 2,816 | 4.25 | 4 | """Set
A set is a collection which is unordered and unindexed. In Python sets are written with curly brackets."""
setex={'java','python',True,False,45,2.3}
print(setex)
"""Access Items
You cannot access items in a set by referring to an index, since sets are unordered the items has no index.
But you can loop through ... | true |
84d13c65e3b036f0887da9a009a67d65385b17e0 | aadroher/pingpong | /pingpong/models/calendar.py | 1,089 | 4.125 | 4 |
from datetime import datetime
"""
Este módulo representa el calendario general para la
aplicación. Puesto que es único y no hay que guardar
ninguna información sobre el mismo, se representa de
esta forma y no mediante una clase.
"""
def current_year():
"""
:return: El año en el que nos encontramos.
"""
... | false |
b7c9deb2e1fd40b3b79343e8afd5f1978ffcb0ae | ayoblvck/Startng-Backend | /Python task 1.py | 225 | 4.5625 | 5 | # a Python program to find the Area of a Circle using its radius
import math
radius = float(input('Please enter the radius of the circle: '))
area = math.pi * radius * radius
print ("Area of the circle is:%.2f= " %area)
| true |
b6dd55f61795983858f76cbd06978865722c9850 | isolis1210/HW2-Python | /calculator.py | 1,487 | 4.5 | 4 | def calculator():
#These lines take inputed values from the user and store them in variables
number_1 = float(float(input('Please enter the first number: ')))
number_2 = float(float(input('Please enter the second number: ')))
operation = input('Please type in the math operation you would like to complet... | true |
32a429bae97a0678517dff15dbce80bbd25ee46a | NSNCareers/DataScience | /Dir_OOP/classVariables.py | 1,374 | 4.3125 | 4 |
# Class variables are those shared by all instances of a class
class Employee:
raise_amount = 10.04
gmail = '@gmail.com'
yahoo = '@yahoo.com'
num_of_employees = 0
def __init__( self, fistName, lastName, gender, pay):
self.first = fistName
self.last = lastName
self.ge... | true |
e69539f58ab8f159c826d552d852c08cd79a022f | Developirv/PythonLab1 | /exercise-5.py | 512 | 4.25 | 4 | # DELIVERABLE LAB 03/05/2019 5/6
# exercise-05 Fibonacci sequence for first 50 terms
# Write the code that:
# 1. Calculates and prints the first 50 terms of the fibonacci sequence.
f = 1
current = 1
former = 0
for term in range (50):
if term == 0:
print(f"term: {term} / number: 0")
elif term == 1:
prin... | true |
91bcd6886a825494f0013eb115ee3f8ac5871ec8 | LialinMaxim/Toweya | /league_table.py | 2,866 | 4.21875 | 4 | """
The LeagueTable class tracks the score of each player in a league.
After each game, the player records their score with the record_result function.
The player's rank in the league is calculated using the following logic:
* The player with the highest score is ranked first (rank 1). The player with the lowest score... | true |
91e32dc173b88a2cbdb441627633957137064961 | kunaljha5/python_learn_101 | /scripts/pyhton_list_operations_remove_pop_insert_append_sort.py | 1,554 | 4.25 | 4 | # https://www.hackerrank.com/challenges/python-lists/problem
#Consider a list (list = []). You can perform the following commands:
# insert i e: Insert integer at position.
# print: Print the list.
# remove e: Delete the first occurrence of integer.
# append e: Insert integer at the end of the list.
# ... | true |
7d180da0bcf7f111d1d306897566ec129cd5ef0e | mebsahle/data-structure-and-algorithms | /sorting-algorithms/pancakeSort.py | 882 | 4.125 | 4 | # Python code of Pancake Sorting Algorithm
def maxNum(arr, size):
num = 0
for index in range(0, size+1):
if arr[index] > arr[num] :
num = index
return num
def flipArr(arr, index):
begin = 0
while begin < index :
temp = arr[begin]
... | true |
0bb65cb9b5d9e6b30d70b2613cc224cb39c24d5e | balanalina/Formal-Languages-and-Compiler-Design | /Scanner/symbol_table/linked_list.py | 1,973 | 4.21875 | 4 | # class for a Node
class Node:
def __init__(self, val=None):
self.val = val # holds the value of the node
self.nextNode = None # holds the next node
# implementation of a singly linked list
class LinkedList:
def __init__(self, head=None):
self.headNode = head
self.size = 0
... | true |
b63fd63b6a381fd59a4e1f0eb1fef04bdc7886d7 | HurricaneSKC/Practice | /Ifelseproblem.py | 535 | 4.28125 | 4 | # Basic problem utilising if and elif statements
# Take the users age input and determine what level of education the user should be in
age = int(input("Enter your age: "))
# Handle under 5's
if age < 5:
print("Too young for school")
# If the age is 5 Go to Kindergarten
elif age == 5:
print ("Go to Kindergar... | true |
56ff2ec0d608fe22ec4c4a8acf6d0f7789e61f91 | HurricaneSKC/Practice | /FunctionEquation.py | 614 | 4.1875 | 4 | # Problem 10: Create an equation solver, functions
# solve for x
# x + 4 = 9
# x will always be the first value recieved and you will only deal with addition
# Create a function that takes an input equation as a string to solve for x as above example
def string_function(equation):
# separate the function using the s... | true |
fc64ae88890dd66365a2ed43daa92b27cd503224 | Ronaldss/Python | /exercicios/operadores-logicos.py | 405 | 4.21875 | 4 | # -*- coding: utf-8 -*-
# Cometários
# Operações matemáticas + - * / ** %
# Variáveis
# Operadores relacionais == != < > <= >=
# OPERADORES LOGICOS and or not
'''
x = 2
y = 3
print(x == y and x > y)
print(x != y or x < y)
'''
# Exemplo com NOT
nome = input('Qual o seu nome: ')
if not nome =... | false |
01128016296190edce2e8c2a203fe2f40dda23c5 | Ronaldss/Python | /exercicios/revisao/string-metodos-geral2-review.py | 881 | 4.4375 | 4 | # Revisao: Strings - métodos mais usado em geral
print('Concatenando strings')
string1 = 'Estou estudando '
string2 = 'a linguagem de programacao Python'
print('Concatenacao: ' + string1 + string2)
print('\n')
print('Contar quantos caracteres existem no texto em questao: ')
texto = 'My name is Ronald.'
tamanho = l... | false |
c3bd0685bcceacb2bee2ae1cc40bb24aff0cd71c | benjdj6/Hackerrank | /DataStructures/LinkedList/ReverseDoublyLinkedList.py | 533 | 4.125 | 4 | """
Reverse a doubly linked list
head could be None as well for empty list
Node is defined as
class Node(object):
def __init__(self, data=None, next_node=None, prev_node = None):
self.data = data
self.next = next_node
self.prev = prev_node
return the head node of the updated list
"""
de... | true |
d2cb42f27bc8a03906e7f19d28a0bc75467053a3 | Harshad06/Python_programs | /py-programs/args-kwargs.py | 442 | 4.28125 | 4 |
# args/kwargs allows python functions to accept
# arbitary/unspecified amount of arguments & keyword arguments.
# Arguments
def print_args(*args):
print(f"These are my arguments : {args}")
print_args([1,2,3],(20,30),{'key': 4}, 'abc')
#---------------------------------------------------
# Keyword Arguments
def... | true |
a81393a5f71a79fcf1b9bcc44698fdd66ca24be1 | Harshad06/Python_programs | /PANDAS/joinsPandas.py | 739 | 4.125 | 4 | ## MERGE Function
# JOINS in PANDAS ----> [inner/outer/right/left/index]
# importing pandas
import pandas as pd
# Creating Dictionary 1
data1 = {'id': [1, 2, 10, 12],
'val1': ['a', 'b', 'c', 'd']}
a = pd.DataFrame(data1)
# print(a)
# Creating Dictionary 2
data2 = {'id': [1, 2, 9, 8],
'val2': ['p', 'q', '... | false |
1b504b774f87f662641549baee8860ea34fd6fa7 | Harshad06/Python_programs | /useful-functions/accumulate.py | 389 | 4.1875 | 4 |
"""
accumulate() function
> accumulate() belongs to “itertools” module
> accumulate() returns a iterator containing the intermediate results.
> The last number of the iterator returned is operation value of the list.
"""
import itertools
import operator
n = [1,2,3,5,10]
print(list(itertools.accumulate(n, op... | true |
e34ed0465a5fd22c905826be81eda95e1bba69d4 | Harshad06/Python_programs | /PANDAS/joinsIdenticalData.py | 740 | 4.21875 | 4 |
import pandas as pd
df1 = pd.DataFrame([1,1], columns=['col_A'] )
#print("DataFrame #1: \n", df1)
df2 = pd.DataFrame([1,1,1], columns=['col_A'] )
#print("DataFrame #2: \n", df2)
df3 = pd.merge(df1, df2, on='col_A', how='inner')
print("DataFrame after inner join: \n", df3)
# Output: 2x3 --> 6 times it will be ... | true |
c1ecf3355aadf69e8084b30d801024003c562702 | Harshad06/Python_programs | /Dictionary/sortDict.py | 471 | 4.46875 | 4 | # To sort a dictionary -
# this will sort by key
c={2:3, 1:89, 4:5, 3:0}
y = sorted(c.items())
#print(y)
#Another excampple of sort by key
d = { "John":36, "Lucy":24, "Albert":32, "Peter":18, "Bill":41 }
y = sorted(d.keys())
print(y)
x = sorted(d.values())
print(x)
z = sorted(d.items())
print(z)
for k,v in d... | false |
6824c7f37caca3e464bfacb3da444a075808cf09 | Harshad06/Python_programs | /string programs/longestString.py | 454 | 4.59375 | 5 |
# Python3 code to demonstrate working of
# Longest String in list
# using loop
# initialize list
test_list = ['gfg', 'is', 'best', 'for', 'geeks']
# printing original list
print("The original list : " + str(test_list))
# Longest String in list using loop
max_len = -1
for element in test_list:
if len(element) > max... | true |
4360b4921820bf5519f4a23e9300e51cf5a667d8 | Robbie-Wadud/-CS-4200-Project-3 | /List Comprehension Finding Jones.py | 483 | 4.21875 | 4 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 20:22:17 2020
@author: Robbi
"""
print('Let\'s find the last name "Jones" within a list of tuples')
#Creating the list (firstName, lastName)
names = [('Robbie', 'Wadud'),('Matt', 'Jones'),('Lebron', 'James'),('Sarah', 'Jones'),('Serena', 'Williams'),('Ashle... | true |
77e6615697d2b92f1529259c16b8963f617187c2 | sharmasourab93/JustPython | /deepcopy.py | 1,028 | 4.53125 | 5 | """
Python: Copy
Deep Copy Vs Shallow Copy
"""
import copy
def deep_copy(array1):
array2 = copy.deepcopy(array1)
print("The original elements before deep copying")
for i in range(0, len(array1)):
print(array1[i], end=" ")
print('\r')
array2[2][0] = 7
# change reflected in ... | false |
fdca2f44051851ad10fb9ac34b4edf16afe46cb7 | sharmasourab93/JustPython | /tests/pytest/pytest_101/pytest_calculator_example/calculator.py | 1,470 | 4.3125 | 4 | """
Python: Pytest
Pytest 101
Learning pytest with Examples
Calculator Class's PyTest File test_calculator.py
"""
from numbers import Number
from sys import exit
class CalculatorError(Exception):
"""An Exception class for calculator."""
class Calculator:
"""A Terrible Calculator.""... | true |
1be1e0530d028553e0099989161dc24ebc3e1d41 | sharmasourab93/JustPython | /decorators/decorator_example_4.py | 612 | 4.3125 | 4 | """
Python: Decorator Pattern In Python
A Decorator Example 4
Using Decorators with Parameter
Source: Geeksforgeeks.org
"""
def decorator_fun(func):
print("Inside Decorator")
def inner(*args):
print("Inside inner Function")
print("Decorated the Function")
p... | true |
937df73a2265bef32d2ba32ca222c47c8db247b9 | sharmasourab93/JustPython | /decorators/decorator_example_10.py | 950 | 4.21875 | 4 | """
Python: Decorator Pattern in Python
A Decorator Example 10
Func tools & Wrappers
Source: dev.to
(https://dev.to/apcelent/python-decorator-tutorial-with-example-529f)
"""
from functools import wraps
def wrapped_decorator(func):
"""Wrapped Decorator Docstring"""
"""
f... | true |
d5320085808347ab18124a1886072b5b9cfdbe0f | sharmasourab93/JustPython | /oop/oop_iter_vs_next.py | 947 | 4.375 | 4 | """
Python: iter Vs next in Python Class
"""
class PowTwo:
"""Class to implement an iterator of powers of two"""
def __init__(self, max=0):
self.max = max
def __iter__(self):
self.n = 0
return self
def __next__(self):
if self.n <= self.max:
... | true |
332349a979045aa438f80f293690460e34ba8e19 | NicholasDowell/Matrix-Calculator | /Matrix.py | 2,856 | 4.375 | 4 | # This will be the fundamental matrix that is used for Matrix Operations
# it stores a 2d grid of values
# 11
# To DO: Restrict the methods so that they will not resize the matrix when they shouldnt
# CONVENTION is [ROW][COLUMN] BE CAREFUL
class Matrix:
def __init__(self, rows, columns):
self._d... | true |
971383f0baa1427023b3884f19d11c9d1f590055 | AGKirby/InClassGit | /calc.py | 1,014 | 4.1875 | 4 | def calc():
# get user input
try:
num1 = int(input("Please enter the first number: ")) # get a number from the user
num2 = int(input("Please enter the second number: ")) # get a number from the user
except: # if the user did not enter an integer
print("Invalid input: integer expecte... | true |
2a09f466b0eb647e577bf0835a4d55e4cbae1792 | iambillal/inf1340_2015_asst1 | /exercise2.py | 1,212 | 4.46875 | 4 | def name_that_shape():
"""
For a given number of sides in a regular polygon, returns the shape name
Inputs: user input 3-10
Expected Outputs: triangle, quadrilateral, pentagon, hexagon, heptagon, octagon, nonagon, decagon.
Errors: 0,1,2, any number greater than 10 and any other string
"""
... | true |
a6e83344a0aea87e35d4cca71c27eb2c8e4db307 | LeoImenes/SENAI | /1 DES/FPOO/python rafa/conv.py | 982 | 4.125 | 4 | print("Digite 1 para converter um número decimal\nDigite 2 para converter um número bínario\nDigite 3 para converter um número octal\nDigite 4 para converter um número hexadecimal")
a=int(input())
if a==1:
a = int(input("Qual o seu número decimal? "))
b = bin(a)
c = oct(a)
d = hex(a)
print(f"Seu núm... | false |
e7d5e6065d6645662ddd07ed34d242631b7bd686 | robinchew/misc | /interview/Edward/test.py | 565 | 4.125 | 4 | import time
import datetime
def test(add):
print "current date"
now = datetime.date.today()
print now
print add, "days after current time"
print now + datetime.timedelta(days=add)
test(4)
def test2(date):
print "current date test2"
now = datetime.datetime.now()
difference = date - now
print... | false |
3674c62c670327d324a08a2bb13a6cc111b9b973 | mischelay2001/WTCIS115 | /PythonProjects/CIS115PythonProjects/Lab4Problem4.py | 1,143 | 4.34375 | 4 | __author__ = 'Michele'
#How to test either a string or numeric
#Initial age question and valid entry test
age = int(input('Enter the child\'s age: '))
BooleanValidAge = age <= 200
#Is age entry valid
while BooleanValidAge == False:
print('Invalid entry. Please re-enter a valid age for the child.')
ag... | true |
2c330237b90116e7f55075a360f4290fe334d533 | mischelay2001/WTCIS115 | /PythonProjects/CIS115PythonProjects/Lab9Problem3.py | 2,927 | 4.375 | 4 | __author__ = 'Michele Johnson'
# Write a program to play the rock-paper-scissors game.
# A single player is playing against the computer.
# In the main function, ask the user to choose rock, paper or scissors.
# Then randomly pick a choice for the computer.
# Pass the choices of the player and the computer to ... | true |
ba9e9753af0ce41ee2b220db1dc202677a8d73e7 | mischelay2001/WTCIS115 | /PythonProjects/CIS115PythonProjects/Lab5Problem1.py | 1,570 | 4.25 | 4 | __author__ = 'Michele'
print('It is time to select your health plan for the year.')
print('You will need to select from the table below:')
print('')
print('Health Plan Code Coverage Premium')
print('E Employee Only $40')
print('S ... | true |
c3bec77407894ad0425a6c44b57733ff67beb1d7 | EtienneBrJ/holbertonschool-higher_level_programming | /0x0C-python-almost_a_circle/models/square.py | 2,210 | 4.21875 | 4 | #!/usr/bin/python3
""" Module Square
"""
from models.rectangle import Rectangle
class Square(Rectangle):
""" Square class inherits from Rectangle
"""
def __init__(self, size, x=0, y=0, id=None):
""" Initialize an instance square from the class Rectangle.
"""
super().__init__(size, ... | true |
64c8a33693b8db0533a3baa275c47a7d4b8e8e38 | GokoshiJr/algoritmos2-py | /src/modular/invertir.py | 246 | 4.125 | 4 | # 3. Invertir un numero
numero = int(input('Ingrese un numero: '))
digito = result = 0
aux = numero
while (aux > 0):
digito = aux % 10
result = (result * 10) + digito
aux //= 10
print('Su inverso es:', result)
| false |
366b54996d3152ac7bee13e218f167480699acd8 | rutujak24/crioTryout | /swapCase.py | 707 | 4.4375 | 4 | You are given a string and your task is to swap cases. In other words, convert all lowercase letters to uppercase letters and vice versa.
'''For Example:
Www.HackerRank.com → wWW.hACKERrANK.COM
Pythonist 2 → pYTHONIST 2
Input Format
A single line containing a string
.
Constraints
Output Format
Print the modifie... | true |
a14c5a0c660b421fd79e09766fcd924bd76b60c6 | hoang-ph/Othello-with-Python-Processing | /Othello/computer.py | 2,964 | 4.25 | 4 | class Computer:
"""A class represent AI's move for Othello game"""
def __init__(self, board, game_controller, tile_color):
self.gc = game_controller
self.board = board
self.tile_color = tile_color
self.legal_moves = []
def place_tile(self):
"""
:rty... | false |
b585acc6820a2a013d1dacf883fc961d618f78a3 | mlarva/projecteuler | /Project1.py | 743 | 4.1875 | 4 | #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.
def multipleFinder(min, max, *multiples):
multiplesSet = set()
if min >= max:
print("Minimum is not smaller than ma... | true |
6205ce04a990b36d3a18e04968ebdadf9a62f29a | LisaVysochyn/lab-3 | /1.py | 702 | 4.15625 | 4 | """
The Fibonacci numbers are the sequence below, where the first two numbers are 1, and each number thereafter is the sum of the two preceding numbers. Write a program that asks the user how many Fibonacci numbers to print and then prints that many.
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …
>>> Введіть скільки чисе... | false |
7696267a751e50ff101e20be49ae26ebf036222d | soedjais/dodysw-hg | /ProjectEuler/Problem45.py | 1,201 | 4.3125 | 4 | import math
def is_pentagonal(y):
"""
y = x(3x-1)/2.
y is the input, we need to find x, and whether it's an positive integer. Using quadratic equation, we convert to the following:
x = (-b +- sqrt(b^2-4ac))/2a
since y = x(3x-1)/2 is 1.5*x^2 - 0.5*x - y = 0, then a = 1.5, b = 0.5, c = -y
x =... | false |
b1953a6b8652ea8744c6ca9c935a7ec9d04ac4b6 | MikeCullimore/project-euler | /project_euler_problem_0001.py | 2,131 | 4.3125 | 4 | """
project_euler_problem_0001.py
Worked solution to problem 1 from Project Euler:
https://projecteuler.net/problem=1
Problem title: Multiples of 3 and 5
Problem: 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... | true |
256b3cf6e6919388e85f3e16fd025c4fc1c3b688 | suspectpart/misc | /cellular_automaton/cellular_automaton.py | 1,787 | 4.28125 | 4 | #!/usr/bin/python
'''
Implementation of the Elementary Cellular Automaton
For an explanation of the Elementary Cellular Automaton, read here:
http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
The script takes three parameters:
- A generation zero as a starting pattern, e.g. 1 or 101 or 1110111
- A rul... | true |
86cf4cb652c0c62011f157bfd98259d7a092d005 | anaruzz/holbertonschool-machine_learning | /math/0x06-multivariate_prob/0-mean_cov.py | 564 | 4.125 | 4 | #!/usr/bin/env python3
"""
A function that calculates the mean and covariance of a data set
"""
import numpy as np
def mean_cov(X):
"""
Returns mean of the data set
and covariance matrix of the data set
"""
if type(X) is not np.ndarray or len(X.shape) != 2:
raise TypeError("X must be a 2D ... | true |
3a904d372a32c4d10dbf04e2e0f8653bf6c0d995 | anaruzz/holbertonschool-machine_learning | /math/0x00-linear_algebra/3-flip_me_over.py | 398 | 4.15625 | 4 | #!/usr/bin/env python3
"""
Script that returns the transpose of a 2D matrix
"""
def matrix_transpose(matrix):
"""
function that returns
the transpose of a 2D matrix,
"""
i = 0
new = [[0 for i in range(len(matrix))] for j in range(len(matrix[i]))]
for i in range(len(matrix)):
for j ... | true |
5ebd7f954d1ebf345d87d7cb8afa11bfbb9846a8 | whatarthurcodes/Swedish-Test | /swedishtest.py | 1,843 | 4.125 | 4 | import sys
import random
import csv
def swedishtest():
word_bank = select_module()
lang = choose_lang()
questions(word_bank, lang)
def select_module():
file_found = False
while file_found is False:
try:
module_choice = raw_input('Enter the file name. ex. module1.csv \n')
module = open(module_choi... | true |
9028afe374d90a565b23cf9ff102d7dd70025ba1 | mfaria724/CI2691-lab-algoritmos-1 | /Laboratorio 05/Laboratorio/Lab05Ejercicio3r.py | 1,265 | 4.125 | 4 | #
# Lab05Ejercicio3r.py
#
# DESCRIPCIÓN: Programa que dada una secuencia de N números naturales
# pertenecientes al conjunto {1,2,3,4} devuelve el número de ocurrencias
# de cada elemento del conjunto en la secuencia dada.
#
# Autor:
# Manuel Faria 15-10463
#
# Ultima modificacion: 22/02/2018
#
import sys # Se imp... | false |
257ecb3f0097ccf743b102462cb4f14c37b5cc2d | mlawan/lpthw | /ex39/ex39.py | 1,591 | 4.3125 | 4 | # creates a mapping to state to abbreviation
states ={
'Oregon': 'OR',
'Florida' : 'FL',
'CAlifornia' : 'CA',
'Konduga' : 'KDG',
'Maiduguri': 'Mag'
}
#creats a babsic set of states and some cities in them
cities = {
'CA': 'SanfranCisco',
'KDG': 'Sandiya',
'FL': 'Florida',
'Mag': 'MMC'
}
#ADD SOME MORE cities
cities['N... | false |
28a5ceae1d0b29e00c0a7e657c5ea9f3ce3ab08f | mlawan/lpthw | /ex30/ex30.py | 518 | 4.15625 | 4 | people = 30
cars = 40
trucks = 40
if cars > people or trucks < cars:
print("We should take the cars")
elif cars< people:
print("We should not take the cars")
else:
print(" We cant decide.")
if trucks > cars and cars == trucks:
print("Thats too much of trucks")
elif trucks <cars:
print("Maybe we c... | true |
8950ac176813b900f3f4e7a4d3358e977987552e | andrewn488/5061-entire-class | /Week 05/pec1_decimal_to_binary.py | 741 | 4.21875 | 4 | """PEC1: Decimal to Binary
Author: Andrew Nalundasan
For: OMSBA 5061, Seattle University
"""
print('When you enter a non negative integer a string in binary representation will be shown')
n = int(input('Enter a non- negative integer: '))
if n < 0:
print('You must enter a non- negative integer: ')
p... | false |
0a3c8d459722962a4cf49d524456b76d2069fc9a | python4kidsproblems/Operators | /comparison_operators.py | 1,266 | 4.28125 | 4 | # Comarison Operators Practice Problems
# How to use this file:
# Copy this to your python (.py) file, and write your code in the given space
################################### Q1 ###################################
# Write a program that asks the user, #
# "Are you older th... | true |
fc09bc969303a4bddf367fc3748ffb53e20e7ba0 | rsurpur20/ComputerScienceHonors | /Classwork/convertor.py | 1,114 | 4.25 | 4 | # convert dollars to other currencies
import math
import random
#
# dollars=float(input("Dollars to convert: \n $")) #gets the input of how many dollars, the user wants to convert
#
# yen=dollars*111.47 #the conversion
# euro=dollars*.86
# peso=dollars*37.9
# yuan=dollars*6.87
#
# print("$"+str(dollars) + " in yen is"... | true |
111c5346ca6f32e8f25608a1d2cf2ea143056ed6 | rsurpur20/ComputerScienceHonors | /minesweeper/minesweepergame.py | 2,394 | 4.25 | 4 | # https://snakify.org/en/lessons/two_dimensional_lists_arrays/
#Daniel helped me,and I understand
import random
widthinput=int(input("width?\n"))+2 #number or colomns
heightinput=int(input("height ?\n"))+2 #number of rows
bombsinput=int(input("number of bombs?\n"))#number of bombs
width=[]
height=[]
# j=[]
# # for x in... | true |
bac4234eb3635e084517cab020e5b8761e77967f | joelstanner/codeeval | /python_solutions/HAPPY_NUMBERS/happy_numbers.py | 1,485 | 4.3125 | 4 | """
A happy number is defined by the following process. Starting with any positive
integer, replace the number by the sum of the squares of its digits, and repeat
the process until the number equals 1 (where it will stay), or it loops
endlessly in a cycle which does not include 1. Those numbers for which this
process e... | true |
9668ba9aad876675efe26dc644d08c3f8cb049a1 | joelstanner/codeeval | /python_solutions/NUMBER_PAIRS/NUMBER_PAIRS.py | 2,563 | 4.3125 | 4 | """
You are given a sorted array of positive integers and a number 'X'. Print out
all pairs of numbers whose sum is equal to X. Print out only unique pairs and
the pairs should be in ascending order
INPUT SAMPLE:
Your program should accept as its first argument a filename. This file will
contain a comma separated lis... | true |
a73717e0842d17d44f275aeafba71950e88e5b55 | joelstanner/codeeval | /python_solutions/PENULTIMATE_WORD/PENULTIMATE_WORD.py | 583 | 4.4375 | 4 | """
Write a program which finds the next-to-last word in a string.
INPUT SAMPLE:
Your program should accept as its first argument a path to a filename. Input
example is the following:
some line with text
another line
Each line has more than one word.
OUTPUT SAMPLE:
Print the next-to-last word in the following way... | true |
0dc79dcc5c3b026ad10e1328ed2ef84a12514fb1 | joelstanner/codeeval | /python_solutions/UNIQUE_ELEMENTS/unique_elements.py | 809 | 4.4375 | 4 | """
You are given a sorted list of numbers with duplicates. Print out the sorted
list with duplicates removed.
INPUT SAMPLE:
File containing a list of sorted integers, comma delimited, one per line. E.g.
1,1,1,2,2,3,3,4,4
2,3,4,5,5
OUTPUT SAMPLE:
Print out the sorted list with duplicates removed, one per line.
E.g... | true |
3b9c14de993878342e89d659c501c39b27078042 | joelstanner/codeeval | /python_solutions/SIMPLE_SORTING/SIMPLE_SORTING.py | 873 | 4.53125 | 5 | """
Write a program which sorts numbers.
INPUT SAMPLE:
Your program should accept as its first argument a path to a filename. Input
example is the following
70.920 -38.797 14.354 99.323 90.374 7.581
-37.507 -3.263 40.079 27.999 65.213 -55.552
OUTPUT SAMPLE:
Print sorted numbers in the following way. Please note, t... | true |
66a16d29f30d44d93ca5f219d6d51752633364e2 | jDavidZapata/Algorithms | /AlgorithmsInPython/stack.py | 329 | 4.125 | 4 |
# Stack implementation in Python
stack = []
# Add elements into stack
stack.append('a')
stack.append('b')
stack.append('c')
print('Stack')
print(stack)
# Popping elements from stack
print('\nAfter popping an element from the stack:')
print(stack.pop())
print(stack)
print('\nStack after elements are poped:')
prin... | true |
40b59d22b13152532166e69e31b4168a177d53c3 | fanya85/lesson2 | /if-2.py | 1,126 | 4.25 | 4 | """
Домашнее задание №1
Условный оператор: Сравнение строк
* Написать функцию, которая принимает на вход две строки
* Проверить, является ли то, что передано функции, строками.
Если нет - вернуть 0
* Если строки одинаковые, вернуть 1
* Если строки разные и первая длиннее, вернуть 2
* Если строки разные и вторая стро... | false |
b6a6ac69c4730e0f7ee4e2bf889271812d5f168d | ogrudko/leetcode_problems | /easy/count_prime.py | 804 | 4.15625 | 4 | '''
Problem:
Count the number of prime numbers less than a non-negative number, n.
Example 1:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
Example 2:
Input: n = 0
Output: 0
Example 3:
Input: n = 1
Output: 0
Constraints:
0 <= n <= 5000000
'''
# Solution
class ... | true |
06aab6ad1bc538a8dbc0435ee7bd2d1f25c6d143 | AspiringOliver/kkb | /1 基础语法/课后作业/13-类与对象 练习题.py | 2,325 | 4.34375 | 4 | #self的作用:self会在类的实例化中接收传入的数据, 在代码中运行。
#类中的一个类方法需要调用另一个类方法或类属性,都需要使用self。
#总结:类方法中调用类内部属性或者是其他方法时,需要使用self来代表实例。
#1.1.0
# class Information(object): #object是所有类的父类
# def __init__(self, name):
# #初试化方法无需调用,对象实例化时自动执行
# print(name)
# self.n = name
# #此时的self.n可以理解为Information这个类的‘全局变量’... | false |
393fe94266faade066b3ca0112a434622e2dff22 | rawatsushil/datastructure | /code/DP/tushar/staircase.py | 473 | 4.15625 | 4 | # Given a staircase and give you can take 1 or 2 steps at a time, how many ways you can reach nth step.
class StairCase:
def __init__(self, steps):
self.steps = steps
self.step_arr = []
def find_steps(self):
self.step_arr.append(1)
self.step_arr.append(2)
for i in range(2, self.steps):
self.step_arr.ap... | false |
b93e6ff80e0e807a8da0739d03b8a04317532fc4 | herisson31/Python-3-Exercicios-1-ao-104 | /ex017 - Catetos e Hipotenusa.py | 352 | 4.125 | 4 | '''Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triângulo retângulo.
Calcule e mostre o comprimento da hipotenusa.'''
import math
co = float(input('Digite o cateto oposto: '))
ca = float(input('Digite o cateto adjacente: '))
h = co**2 + ca**2
hi= math.sqrt(h)
print('O valor da H... | false |
965ad1a766be9f89266e37e53b1b559864004c64 | herisson31/Python-3-Exercicios-1-ao-104 | /ex022 - Analisador de Textos.py | 533 | 4.25 | 4 | '''022: Crie um programa que leia o nome completo de uma pessoa e mostre:
- O nome com todas as letras maiúsculas e minúsculas.
- Quantas letras ao todo (sem considerar espaços).
- Quantas letras tem o primeiro nome'''
nome = input('Digite seu nome completo: ')
print('Seu nome com todas as letras Maiuscula: {}'.format... | false |
0958494baedd0b356df208926b34a4a0c9c0a961 | herisson31/Python-3-Exercicios-1-ao-104 | /ex063 - Sequência de Fibonacci v1.0.py | 494 | 4.21875 | 4 | '''063: Escreva um programa que leia um número N inteiro qualquer e mostre na tela
os N primeiros elementos de uma Sequência de Fibonacci.
Ex: 0 - 1 - 1 - 2 - 3 - 5 - 8'''
print('-'*30)
print('Sequencia de Fibonacci')
print('-'*30)
n = int(input('Digite o termo da sequencia: '))
t1 = 0
t2 = 1
print('~'*30)
print('{... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.