blob_id stringlengths 40 40 | repo_name stringlengths 5 127 | path stringlengths 2 523 | length_bytes int64 22 3.06M | score float64 3.5 5.34 | int_score int64 4 5 | text stringlengths 22 3.06M |
|---|---|---|---|---|---|---|
d282841fed0820e370bb96a7934b4d7fd3a24471 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/N0vA/lesson_04/dict_lab.py | 1,264 | 3.765625 | 4 | #!/usr/bin/env python3
# Make dictionary as provide
dict_1 = dict(name='Chris', city='Seattle', cake='chocolate')
print(dict_1)
# Delete cake entry
dict_1.pop('cake')
print(dict_1)
# Add fruit -- Mango
dict_1['fruit'] = 'Mango'
print(dict_1)
# Display dictionary keys
print(dict_1.keys())
# Print dictionary values
... |
1640c7c6bef63b63e994f28ffa5cad1bbd2a36b7 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/phrost/Lesson03/Exercises/Series_3.py | 478 | 3.9375 | 4 | fruit_upper = ['Apples', 'Pears', 'Oranges', 'Peaches']
fruit_lower = [fruit.lower() for fruit in fruit_upper]
fruit_copy = list(fruit_lower)
for fruit in fruit_lower:
while True:
fruit_v = input(f'do you like {fruit}: ')
if fruit_v.lower() == 'yes':
break
elif fruit_v.lower() ==... |
bc1fe51df6dabcadf392317ac91e359f7e565e48 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kimc05/Lesson08/circle.py | 1,443 | 4.4375 | 4 | """
Christine Kim
Lesson 8
Assignment Circles
"""
import math
class Circle():
#initiate circle with radius
def __init__(self, radius):
self.radius = radius
def __str__(self):
return "Circle with radius: {}".format(self.radius)
def __repr__(self):
return "Circle({})".format(se... |
1ca373999a0bf0ed7da537d07483c221cbe53721 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/steve_walker/lesson03/mailroom.py | 3,157 | 3.984375 | 4 | #!/usr/bin/env python3
import sys
# Hard coded donor records
donor_records = [("Rhianna", [747, 3030303, 1968950]),
("Grumps", [5.99]), ("EatPraySlay", [100000,200000, 300000]),
("Muir", [469503, 50000, 186409]), ("Spacewalker", [4406, 342])]
# Store new donation record, then create e-mail to thank donor
de... |
ec8f871bad690fa1354b2adb8c811d6cc2efc1ba | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/scott_bromley/lesson03/slicing.py | 2,775 | 4.09375 | 4 | #!/usr/bin/env python3
# Write some functions that take a sequence as an argument, and return a copy of that sequence:
# (1) with the first and last items exchanged.
# (2) with every other item removed.
# (3) with the first 4 and the last 4 items removed, and then every other item in between.
# (4) with the elements r... |
2f7f02ab81d60c8175980069e2a805b72e1b9f54 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/humberto_gonzalez/Lesson2/fizzBuzz.py | 325 | 4.0625 | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 6 18:28:56 2019
@author: humberto gonzalez
"""
def fizzBuzz(n):
if n%5==0 and n%3==0:
print('FizzBuzz')
elif n%3==0:
print('Fizz')
elif n%5==0:
print('Buzz')
else:
print(str(n))
for i in range(101):... |
52ca43978d8ddd88d5ea955e0618435a126b96f3 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/alexander_boone/lesson03/exercises/slicing.py | 2,387 | 4.0625 | 4 | # define exchange_first_last
def exchange_first_last(seq):
"""Exchange the first and last items of a sequence."""
return seq[-1:] + seq[1:-1] + seq[:1]
# define remove_every_other
def remove_every_other(seq):
"""Remove every other item in a sequence."""
return seq[::2]
# define remove_end_fours
def re... |
4007145b5121825c67d73f3bbef5a9ceab1f8d42 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jacob_daylong/Lesson 3/MailRoom/mailroom.py | 3,330 | 3.953125 | 4 |
#Write a small command-line script called mailroom.py. This script should be executable. The script should accomplish the following goals:
#It should have a data structure that holds a list of your donors and a history of the amounts they have donated.
#This structure should be populated at first with at least five ... |
68163531259e1ec3f8bc2838f873060c9e412207 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/annguan/lesson05/mailroom3.py | 4,348 | 3.71875 | 4 | #!/usr/bin/env python3
### Lesson 5 Mailroom, Part 3, Add Exceptions and Use Comprehensions
from textwrap import dedent
import os
import sys
import math
# a data structure holds a list of donors and a history of the amounts they have donated.
def get_donor_db():
return {'Abraham Lincoln': ("Abraham Lincoln", [14... |
b7ff5f7e293523f6c6c07b9b4d6f0180d16f5dfe | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/thomasvad/lesson3/listlab.py | 1,997 | 4.09375 | 4 | #series 1
#fruit list
fruits = ['Apples', 'Pears', 'Oranges', 'Peaches']
print(fruits, '\n')
# Adding respondent input to list
response = input('What fruit do you want to add? ')
fruits.append(response.capitalize())
print(fruits, '\n')
# returning number and fruit in list
fruitlen = len(fruits)
response2 = input('PLe... |
21b19da299776cc9a20ca787c6f8a7b2f48f6f36 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/mattcasari/lesson04/trigrams.py | 9,265 | 4.125 | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Lesson 4, Exercise 2
@author: Matt Casari
Link: https://uwpce-pythoncert.github.io/PythonCertDevel/exercises/kata_fourteen.html
"""
import sys
import string
import random
import textwrap
from pprint import pprint
BOOK_START_STR = "*** START OF THIS PROJECT GUTENBE... |
f2b721313e23b99aea53565563efd9b5373e0883 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/karl_perez/lesson03/list_lab.py | 2,968 | 4.25 | 4 | #!/usr/bin/env python3
"""Series 1"""
#Create a list that contains “Apples”, “Pears”, “Oranges” and “Peaches”.
list_original = ['Apples', 'Pears', 'Oranges', 'Peaches']
series1 = list_original[:]
#Display the list (plain old print() is fine…).
print(series1)
#Ask the user for another fruit and add it to the end of the... |
3c91c177004d04b82afa1f90dc80fb41ddafb52f | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/IanMayther/Lesson04/dict_lab.py | 1,078 | 3.84375 | 4 | #!/usr/bin/env python3
#Dictionaries 1
person = dict({('name','Chris'),('city','Seattle'),('cake','Chocolate')})
print(person)
del person['cake']
print(person)
person.update({'fruit': 'Mango'})
print(person.keys())
print(person.values())
#Dictionaries 2
#return to original
del person['fruit']
person.update({'ca... |
fba4bb1f6f02ab6e38ce783d943fe19719145a12 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/rfelts/lesson08/test_circle_pytest.py | 3,979 | 4.125 | 4 | #!/usr/bin/env python3
# Russell Felts
# Assignment 8 - Circle Class Unit Tests
import pytest
import math
from circle_class import Circle
from circle_class import Sphere
def test_init_circle():
""" Test that a circle can be initialized """
circle = Circle(7)
assert circle.radius == 7
def test_get_ci... |
a5a1f4db84ae2a0601fec667d9c942fbd7ee7fd1 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Jaidjen/lesson03/list_lab.py | 1,485 | 4.03125 | 4 | #Series 1
Fruits=["Apples", "Pears", "Oranges", "Peaches"]
print(Fruits)
New_Fruit=input('Please add another fruit to the list: ')
Fruits.append(str(New_Fruit))
print(Fruits)
User_input=int(input('Please choose a fruit by providing a number: '))
if User_input < 1:
print("Pleasa pick a number greater than zero")
... |
da22a15916a5dc3e1106d278c9eb041dee62fa5e | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/bcoates/lesson01/codebat.py | 2,916 | 3.515625 | 4 | # Warmup-1
def sleep_in(weekday, vacation):
if weekday == False or vacation == True:
return True
else:
return False
def diff21(n):
if n < 21:
return abs(n - 21)
else:
return abs(n - 21) * 2
def parrot_trouble(talking, hour):
if talking == True:
if hour < 7 ... |
2570ddcfb945d60737907e503206cbb4edd62ae5 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Z_shen/lesson08/circle.py | 1,356 | 3.921875 | 4 | import math
class Circle:
def __init__(self, the_radius):
self.radius = the_radius
@property
def diameter(self):
return self.radius * 2
@diameter.setter
def diameter(self, the_diameter):
self.radius = the_diameter / 2
@property
def area(self):
return (se... |
0d5fd308f62f9a3975962cae198760abca9fb8aa | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/scotchwsplenda/Lesson_3/Exercises/slicing_lab.py | 1,303 | 3.828125 | 4 | a_string = "this is a string"
a_tuple = (2, 54, 13, 12, 5, 32)
def first_last(x):
'''with the first and last items exchanged.'''
return x[-1:]+x[1:-1]+x[:1]
assert first_last(a_string) == "ghis is a strint"
assert first_last(a_tuple) == (32, 54, 13, 12, 5, 2)
def ery_oth(x):
'''with every other item r... |
983110b661be7abfd83e945bec77770a0fcae9e6 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jack_anderson/lesson03/mailroom.py | 5,194 | 4.125 | 4 | #!/usr/bin/env python3
"""
Jack Anderson
02/14/2020
UW PY210
Mailroom assignment part 1
"""
# The list of donors and their amounts donated
donors_list = [
['Bubbles Trailer',[1500, 2523, 3012]],
['Julien Park',[2520.92, 8623.12]],
['Ricky Boys',[7042.76, 3845.56, 5123.25]],
['Jack Anderson',[1044, 223... |
02cd3405e8db0f877873ca0628b06481c6a362f0 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Shweta/lesson02/gridFunctionWithTwoArgs.py | 523 | 4 | 4 | #Print Grid Value using python function with two arguments
def plusminus(n,m):
for i in range(n):
print('+',end=' ')
print(('-' + ' ' ) * int(m),end=' ')
print('+')
def pipe(n,m):
for i in range(m):
for i in range(n+1):
print('|',end... |
0a7d8d494efb9b0e057c330a842c3967cd437013 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/shodges/lesson03/list_lab.py | 1,857 | 3.953125 | 4 | #!/usr/bin/env python3
# series 1
fruits = ['Apples', 'Pears', 'Oranges', 'Peaches']
print(fruits)
fruitprompt = ''
while not fruitprompt:
fruitprompt = input('Name a fruit, any fruit! ')
fruits.append(fruitprompt)
print(fruits)
fruitprompt = input('Ok, now pick a number! ')
if int(fruitprompt) < 1: # this wi... |
027f7918bb095a8577f812a04f1872ae0ca83b74 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/stellie/lesson04/mailroom2.py | 4,569 | 4.3125 | 4 | #!/usr/bin/env python3
# Stella Kim
# Assignment 2: Mailroom Part 2
"""
This program lists donors and their donation amounts. A user is able to
choose from a menu of 3 donation-related actions: send a thank you, create
a report or quit the program.
"""
import sys
# Lists donors and their contributions
donor_db =... |
7a2ce3573a8b7fbbdc4225e7ee8ff97bf77433cc | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/headieh_godwin/lesson02/grid_printer.py | 953 | 3.75 | 4 | #PART 1
print('Part 1')
def grid():
column = '+' + ' -' * 4 + '+' + ' -' * 4 + '+'
rows = '|' + ' ' * 8 + '|' + ' ' * 8 + '|'
print (column)
print (rows)
print (rows)
print (rows)
print (rows)
print (column)
print (rows)
print (rows)
print (rows)
print (rows)
print... |
8bf48446e7fc571eba9629738e3be6fd559f0168 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/humberto_gonzalez/session09/cli_main.py | 2,696 | 3.90625 | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 21 12:47:23 2019
@author: humberto
"""
import sys
from donor_models import donorCollection
from donor_models import Donor
#Intializing a donor database
donorA = Donor("Tyrod Taylor")
donorA.add_donation(1000)
donorA.add_donation(50)
donorA.add_don... |
b0cdb8c87c76f5f383b473fb57aadb72d3399e06 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/csimmons/lesson02/series.py | 2,274 | 4.46875 | 4 | #!/usr/bin/env python3
# Craig Simmons
# Python 210
# series.py - Lesson02 - Fibonacci Exercises
# Created 11/13/2020 - csimmons
# Modified 11/14/2020 - csimmmons
def sum_series(n,first=0,second=1):
""" Compute the nth value of a summation series.
:param first=0: value of zeroth element in the series
:par... |
31db82ae7a9a15b025028945516694867086de4b | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/shodges/lesson08/test_circle.py | 6,091 | 3.6875 | 4 | #!/usr/bin/env python3
import pytest, math
from circle import *
def test_create_circle():
"""
Test creation of a circle and output of its radius.
Expected output is:
c1 -- raises TypeError
c2 == 8
c3 == 3.14
"""
# Validate getting a TypeError if we don't pass a numeric radius
with... |
296b00ca421cdc03c20700e901c77bf760babb5a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jason_jenkins/lesson01/Logic2.py | 1,325 | 3.59375 | 4 | # Lesson 1: Logic2
def make_bricks(small, big, goal):
if(big != 0) and big > goal // 5:
big = goal // 5
return big * 5 + small >= goal
def lone_sum(a, b, c):
sum = 0
if (a != b and a != c):
sum += a
if (b != a and b != c):
sum += b
if (c != a and c != b):
... |
4174277a463cf7388a64db50feda0265596121ba | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/andrew_garcia/lesson_02/Grid_Printer_3.py | 1,306 | 4.21875 | 4 | '''
Andrew Garcia
Grid Printer 3
6/2/19
'''
def print_grid2(row_column, size):
def horizontal(): # creates horizontal sections
print('\n', end='')
print('+', end='')
for number in range(size): # creates first horizontal side of grid
print(' - ', end='')
print('+', end=... |
69f216e230869960e7faea947d04f23d5249efe0 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kimc05/Lesson09/cli_main.py | 4,360 | 4.0625 | 4 | #!/usr/bin/env python3
"""
Christine Kim
Lesson 9
Client class
"""
import sys
from donor_models import Giver
from donor_models import GiverCollection
#Donor dictionary created
givetree = GiverCollection({"Cullen Rutherford": Giver("Cullen Rutherford", [1500, 4200, 50000]),
"Alistair Their... |
baaeed4242ead2433cba47252658bf0ca575c5b7 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/zach_meves/lesson08/circle.py | 3,347 | 4.59375 | 5 | """
circle.py
Zachary Meves
Python 210
Lesson 08
Circle Assignment
"""
import math
class Circle:
"""A class defining a circle."""
def __init__(self, radius: float):
"""Construct a circle with a given radius.
Parameters
----------
radius : float
Radius to initial... |
f6463a3d08dd4150f242193982444722f533bcd7 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kimc05/Lesson03/List_lab.py | 2,427 | 4.34375 | 4 | #!/usr/bin/env python3
#Christine Kim
#Series 1
print("Series 1")
print()
#Create and display a list of fruits
fruits = ["Apples", "Pears", "Oranges", "Peaches"]
print(fruits)
#Request input from user for list addition
fruits.append(input("Input a fruit to add to the list: "))
print(fruits)
#Request input from user... |
80bc9ed69ccd8bb57fe2422825335ca4ed591762 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kevin_t/lesson2/ex1_grid_printer.py | 974 | 4 | 4 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 1 14:36:21 2019
@author: Kevin
"""
def print_grid2(num_box, size_box):
#This section concatenates the symbols to create the first line of the box
#It considers the number of boxes and size of each box (how many dashes)
line1 = '+'
line1 = line1 + num_box*... |
b41b3820140b20afb147a6fba93c3aed3849c851 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/randi_peterson/session02/GridPrinter_Exercises/GridPrinter_Part3.py | 705 | 3.984375 | 4 | #This Prints the grid for Part 3 of Lesson 2
#This code expands on part 2 to allow choosing of grid format and size
def GridPrinterPart3(dims,units):
#Print grid of the size specified by the user
dashes = "- " * units
#Set spacing for upright bars
spaces = " " *(len(dashes) + 1)
#Creates +-+ rows,... |
24b09f598775e57758b7110bfb5bf8573bb109af | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Jaidjen/lesson03/SlicingLab.py | 616 | 3.671875 | 4 |
def first_and_last(seq):
return seq[-1:] + seq[1:-1] + seq[:1]
myseq = first_and_last("Reverse the order of words")
print(myseq)
def rem_item(seq):
return seq[::2]
myseq1 = rem_item("Reverse the order of words")
print(myseq1)
def rem_four(seq):
return seq[4:-4:2]
myseq2 = rem_four("Reverse the o... |
30d8e4659c6e2a377a2f0df3375646aa527ae7de | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/paul_cooper/lesson_3/list_lab.py | 1,014 | 3.921875 | 4 |
# Series 1
fruits = ['Apples','Pears','Oranges','Peaches']
print(fruits)
user_fruit = [input('Please name another fruit. ')]
fruits = fruits + user_fruit
print(fruits)
num = int(input('Please give a number. '))
print(num, fruits[num-1])
fruits = ['Bananas']+fruits
print(fruits)
fruits.insert(0,'Strawberrys')
print(fr... |
47496e40702fa399ae03bc775318aa066a171394 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/steve_walker/lesson01/task2/logic-2_make_bricks.py | 451 | 4.375 | 4 | # Logic-2 > make_bricks
# We want to make a row of bricks that is goal inches long. We have a number of
# small bricks (1 inch each) and big bricks (5 inches each). Return True if it
# is possible to make the goal by choosing from the given bricks. This is a
# little harder than it looks and can be done without any lo... |
3fcd14e1c53a3d2eda0d65f64f6eab1c87aca701 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/chrissp/lesson04/trigrams.py | 3,810 | 4.25 | 4 | #!/usr/bin/env python3
import sys
import os
import random
import string
prompt = "\n".join(("Welcome to the story maker!",
"Please input a source file name.",
">>> "))
prompt_words = "\n".join(("How many words would you like your story to be?",
">>> "))... |
7c9c1a235810e9b3b3ed02099b481e6032eb5f54 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Deniss_Semcovs/Lesson04/trigrams.py | 728 | 4.125 | 4 | # creating trigram
words = "I wish I may I wish I might".split()
import random
def build_trigrams(words):
trigrams = {}
for i in range(len(words)-2):
pair = tuple(words[i:i+2])
follower = [words[i+2]]
if pair in trigrams:
trigrams[pair] += follower
else:
... |
3b18a1e0c4d9e93df20b379f0e4d1a0b23af7739 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Kristy_Martini/lesson03/strformat_lab_kmarti.py | 2,283 | 3.578125 | 4 | def task_one(a_tuple):
str0 = str(a_tuple[0]).rjust(3,'0')
str1 = '{0:8.2f}'.format(a_tuple[1])
str2 = '{0:.2e}'.format(a_tuple[2])
str3 = '{0:.3e}'.format(a_tuple[3])
task_one_str = 'file_{} : {}, {}, {}'.format(str0, str1, str2, str3)
print(task_one_str)
return task_one_str
def task_two(... |
7fae55365ce8fa7a5cf4f069c86e43c963762724 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/cbrown/Lesson 3/mailroom.py | 3,085 | 4 | 4 | #!/usr/bin/env python3
#Mailroom script part one. Using list data structures
import sys
donors = [("Bill Gates",[539000,235642]),
("Jeff Bezos",[108356,204295,897345]),
("Satya Nadella",[236000,305352]),
("Mark Zuckerberg",[153956.35]),
("Mark Cuban",[459035,369.50,570.89])]
p... |
5919313d0bec108626f9f9b2ae9761bfa9b2dc24 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/gregdevore/lesson02/series.py | 2,388 | 4.34375 | 4 | # Module for Fibonacci series and Lucas numbers
# Also includes function for general summation series (specify first two terms)
def fibonacci(n):
""" Return the nth number in the Fibonacci series (starting from zero index)
Parameters:
n : integer
Number in the Fibonacci series to compute
"""... |
8f6795905fd16e8ca2ee81542700fbae96e4c9bc | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/anthony_mckeever/lesson1/task2/logic-1.py | 1,862 | 4.03125 | 4 | """
Programming In Python - Lesson 1 Task 2: Puzzles - Logic-1
Code Poet: Anthony McKeever
Date: 07/20/2019
"""
# Logic-1 > cigar_party
def cigar_party(cigars, is_weekend):
if is_weekend:
return cigars >= 40
# range(start, end) uses inclusive start and exclusive end.
return cigars in range(40, 61)... |
daecc28f839ba38ce37e3e98b191fd0d21c35c19 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/mark-l-taylor/lesson05/mailroom.py | 4,689 | 4.21875 | 4 | #!/usr/bin/env python3
""" Mailroom Program Part 1
The Last Laugh Program
https://simpsons.fandom.com/wiki/Last_Laugh_Program
"""
import datetime
def get_donor_names():
"""Generate a list of donors."""
return donors.keys()
def add_donation(name):
"""Prompt user for donation and add to donor dat... |
d9a0ff4f9fac9f83291723dfbfd8f010c51e5d3e | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/anthony_mckeever/lesson4/exercise_1/dict_lab.py | 1,660 | 4.28125 | 4 | #!/usr/bin/env python3
"""
Programming In Python - Lesson 4 Exercise 1: Dictionary (and Set) Lab
Code Poet: Anthony McKeever
Start Date: 08/05/2019
End Date: 08/05/2019
"""
# Task 1 - Dictionaries 1
print("Task 1 - Dictionaries:")
fun_dictionary = {"name": "Sophia",
"city": "Seattle",
... |
4ec56c9e0719263dda46b5e842e7532f73d81c59 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/shervs/lesson04/mailroom2.py | 4,022 | 3.71875 | 4 | #!/usr/bin/env python
import sys
import string
donor_dict = {"William Gates, III": [1.50, 653772.32, 12.17],
"Jeff Bezos": [877.33],
"Paul Allen": [663.23, 43.87, 1.32],
"Mark Zuckerberg": [1663.23, 4300.87, 10432.0],
}
prompt = "\n".join(("Please choose from bel... |
c4421469ace088d8a46b1ebc23270d68e497dacc | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/chasedullinger/lesson04/trigrams.py | 4,742 | 4.40625 | 4 | #!/usr/bin/env python3
# PY210 Lesson 04 Trigrams - Chase Dullinger
import sys
import random
def read_in_data(filename, header_line=None, end_of_file_line=None):
"""Reads in filename and returns a list of the lines it contained.
:param filename: filename to read in.
:param header_line: line that signifies... |
5f0b6d80453356ceab3f1118d39ef4aab4c2cd9c | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/steve-long/lesson01-enviro/activities-exercises/task-2-puzzles/logic2.py | 6,282 | 4.53125 | 5 | # Python210 | Fall 2020
# ----------------------------------------------------------------------------------------
# Lesson01
# Task 2: Puzzles (http://codingbat.com/python) (logic2.py)
# Steve Long 2020-09-15
# python /Users/steve/Documents/Project/python/uw_class/python210/lessons/lesson01-enviro/logic2.py
# make_... |
cf7bd07cc21167bc532182a864a1cad91023a85c | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/gregdevore/lesson08/circle.py | 4,436 | 4.1875 | 4 | #!/usr/bin/env python3
# Circle class
from math import pi
class Circle(object):
def __init__(self, radius):
self._radius = radius
@property
def radius(self):
return self._radius
@property
def diameter(self):
return self._radius * 2
@radius.setter
def radius(self, ... |
53c6c9fdd81da8c640155c8aed01eed2e753b45a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/chieu_quach/lesson04/mailroom_part2.py | 6,691 | 3.78125 | 4 |
# Author - Chieu Quach
# Assignment - Lesson 4
# Exercise - Mailroom Part 2
# Prints list of users from donation_list.
# Update new record if username is not found in list
# If use dictionary in tuple list, use append or remove to change.
import sys
global donatio... |
a745d05e6a02ef1dcbf8e66aff92ad23dda0e30f | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jason_jenkins/lesson04/trigrams.py | 2,038 | 4.3125 | 4 | #!/usr/bin/env python3
"""
Lesson 4: Trigram assignment
Course: UW PY210
Author: Jason Jenkins
Notes:
- Requires valid input (Error checking not implemented)
- Future iteration should focus on formating input
-- Strip out punctuation?
-- Remove capitalization?
-- Create paragraphs?
"""
import random
import sys
def... |
6f5a61cf17281a202ca28d43e110d25235a76334 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/nam_vo/lesson02/fizz_buzz.py | 445 | 4.1875 | 4 | # Loop thru each number from 1 to 100
for number in range(1, 101):
# Print "FizzBuzz" for multiples of both three and five
if (number % 3 == 0) and (number % 5 == 0):
print('FizzBuzz')
# Print "Fizz" for multiples of three
elif number % 3 == 0:
print('Fizz')
# Print "Buzz" for multip... |
117f419383bf9738105c14d90bfaa42acf0c9c9c | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Ajay_Randhawa/lesson04/Trigrams.py | 2,420 | 4 | 4 | #!/usr/bin/env python3
import random
import itertools
import string
import re
#words = ['I', 'wish', 'I', 'may', 'I', 'wish', 'I', 'might', 'I', 'wish', 'might', 'wish']
def build_trigrams(words):
"""
build up the trigrams dict from the list of words
returns a dict with:
keys: word pairs
... |
b1931b9b7bc509fb729d601f35cfc148784b3638 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/shodges/lesson08/circle.py | 3,080 | 3.90625 | 4 | #!/usr/bin/env python3
import math
class Circle(object):
def __init__(self, radius):
try:
self._radius = float(radius)
self._diameter = float(radius) * 2
except ValueError:
raise TypeError("radius expects a float")
def __str__(self):
return 'Circle... |
0ccb3742f5f6bc680207c82d952d102f7125e36f | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/annguan/lesson02/fizz_buzz.py | 524 | 4.375 | 4 | #Lesson 2 Fizz Buzz Exercise
#Run program "FizzBuzz()"
def fizz_buzz():
"""fizz_buzz prints the numbers from 1 to 100 inclusive:
for multiples of three print Fizz;
for multiples of five print Buzz
for numbers which are multiples of both three and Five, print FizzBuzz
"""
for i in range (1,101):... |
cb6b3ec734e2a48ed3ff64f64b58118d9b73f8de | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Lina/Lesson9/cli_main.py | 6,321 | 3.921875 | 4 | #! python
#----------------------------------------------------
# Lesson 9 - Assignment 8: Mailroom - Object Oriented
# User interface cli_main.py
#----------------------------------------------------
import sys
from donor_models import Donor, DonorCollection
from operator import itemgetter
from datetime im... |
93d741a687818c77a85d81c5835390dd87707ad3 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/IanMayther/mailroom/Mailroom.py | 4,468 | 3.671875 | 4 | #!/usr/bin/env python3
import pathlib
import io
import os
from collections import defaultdict, namedtuple
#Donors
donors = {"Morgan Stanely": [0.01, 20.00],
"Cornelius Vanderbilt": [800, 15, 10.00],
"John D. Rockefeller": [7000, 150.00, 25],
"Stephen Girard": [60000],
"... |
f42ce9596c045c68fa4c5b0209ed27a3e4c8f38f | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/N0vA/lesson_09/cli_main.py | 2,359 | 3.609375 | 4 | #!/usr/bin/env python
from donor_models import *
import sys
donors = {'Bill Gates': Donor('Bill Gates', [2000000, 250000000]),
'Jeff Bezos': Donor('Jeff Bezos', [2000000]),
'Elon Musk': Donor('Elon Musk', [50000000, 10000000]),
'Howard Schultz': Donor('Howard Schultz', [1000000]... |
dfded6161f67b76fac8ff7fd0893496e81e4f4c4 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/lisa_ferrier/lesson05/comprehension_lab.py | 1,532 | 4.53125 | 5 | #!/usr/bin/env python
# comprehension_lab.py
# Lisa Ferrier, Python 210, Lesson 05
# count even numbers using a list comprehension
def count_evens(nums):
ct_evens = len([num for num in nums if num % 2 == 0])
return ct_evens
food_prefs = {"name": "Chris",
"city": "Seattle",
"cake"... |
16a17d11e32521f8465723d8a72354833bcd84e1 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Shweta/Lesson08/test_circle.py | 1,762 | 4.1875 | 4 | #!/usr/bin/env python
#test code for circle assignment
from circle import *
#######1- test if object can be made and returns the right radius or not####
def test_circle_object():
c=Circle(5)
assert c.radius == 5
def test_cal_diameter():
c=Circle(5)
#diameter=c.cal_diameter(5)
assert c.diameter ... |
c9520adf31b927be371319600a64823bdeed07c2 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jinee_han/lesson04/Trigrams.py | 2,380 | 3.875 | 4 | import random, re, sys
def read_and_clean_text(filename):
'''
Read and clean text file of unwanted characters
:param filename: the relative file name including .txt
:return: a list of words
'''
file = open(filename, "r")
word_collection = []
for line in file:
line = line.strip(... |
fa225432cee3d51a93354082556b770c548ea74d | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/csimmons/lesson01/puzzles.py | 3,924 | 3.71875 | 4 | # Warmup-1 Excercise 1 - "Sleep-in"
def sleep_in(weekday, vacation):
if not weekday or vacation:
return True
else:
return False
# Warmup-1 Excercise 2 - "MonkeyTrouble"
def monkey_trouble(a_smile, b_smile):
if a_smile and b_smile:
return True
if not a_smile and not b_smile:
return True
retu... |
94d6b57a7d5ea05430442d28f3a8bbf235fa0463 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/chris_delapena/lesson02/series.py | 1,604 | 4.40625 | 4 | """
Name: Chris Dela Pena
Date: 4/13/20
Class: UW PCE PY210
Assignment: Lesson 2 Exercise 3 "Fibonacci"
File name: series.py
File summary: Defines functions fibonacci, lucas and sum_series
Descripton of functions:
fibonacci: returns nth number in Fibonacci sequence, where fib(n)=fib(n-1)+fib(n-2), n(0)=0 and n(1)=1... |
2fc4812861b094c555e241ab3f617402166e4ca9 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/choltzman/lesson03/list.py | 1,802 | 3.9375 | 4 | #!/usr/bin/env python3
def main():
# SERIES ONE
fruits = ['Apples', 'Pears', 'Oranges', 'Peaches']
print(fruits)
newfruit = input("Fruit: ")
fruits.append(newfruit)
print(fruits)
idxinput = input("Number: ")
# make sure the input is actually a valid number
try:
idx = int(... |
56bdd45d1559dd70939044097d0d235ba9d773fe | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/domdivakaruni/Lesson03/list_lab.py | 4,401 | 4.3125 | 4 | #!/usr/bin/env python3
# Dominic Divakaruni
# Lesson03 - List Lab
""" Series 1
Create a list that contains “Apples”, “Pears”, “Oranges” and “Peaches”.
Display the list (plain old print() is fine…).
Ask the user for another fruit and add it to the end of the list.
Display the list.
Ask the user for a number and displa... |
e7d4ec7612cb74073096e9388581d9d6795e01c2 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/ABirgenheier/lesson06/mailroom_4.py | 2,928 | 3.953125 | 4 | # !/usr/bin/env python3
import sys
def donars():
return {'Mike': [200, 150, 50],
'Tony': [150, 50, 250],
'Sarah': [150, 150, 150],
}
def menu_options():
print("\n".join(("Please select from the following options:",
"s - Send a Thank You letter to a s... |
94ffec625e57878ed1f9a0eb7bbfc6effd2af8e6 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/mimalvarez_pintor/lesson09/cli_main.py | 2,096 | 3.625 | 4 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 14:00:40 2020
@author: miriam
"""
import sys
from donor_models import Donor
from donor_models import DonorCollection
donors = DonorCollection.initialize_dict(
{'Miriam Pintor': [100, 300],
'Waleed Alvarez': [500, 200, 800],
'Ricardo Gallegos': [50, 75, ... |
4935e41c0a1f707c4d506a34b2148cd022a08b7d | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/cbrown/Lesson 8/circle_class.py | 2,133 | 3.875 | 4 |
from functools import total_ordering
import math
class Circle(object):
def __init__(self, radius):
self.radius = radius
def __str__(self):
return f'Circle with radius: {self.radius}'
def __repr__(self):
return f'Circle({self.radius})'
def __add__(self, other):
tot... |
1fe784f7d0d3fb837952fe74e15d8be183f8f90d | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/srmorehouse/Lesson05/mailroom3.py | 6,253 | 4.125 | 4 | #!/usr/bin/env python3
import os
import sys
"""
Steve Morehouse
Lesson 05
"""
donor_db = {"William Gates, III": [653772.32, 12.17],
"Jeff Bezos": [877.33],
"Paul Allen": [663.23, 43.87, 1.32],
"Mark Zuckerberg": [1663.23, 4300.87, 10432.0]
}
prompt = "\n".join(("Welco... |
b8b02c6cad44ea32423dadfb206994d376d5d90a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/ABirgenheier/lesson03/list.py | 3,500 | 4.375 | 4 | fruits_list = ["pineapple", "zucchini", "apple", "banana", "cucumber", "potato",
"lettuce", "salad", "zest", "orange", "jalapino", "yellow_fruit", "star_fruit"]
def start_series_one():
_continue = input(
"Would you like to add another fruit to the list (y/n)? ")
if _continue == "y" or _... |
9b86bcbb40e06c1db91bf2c02167030ade764691 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/amirg/lesson02/fizz_buzz.py | 221 | 3.546875 | 4 |
i = 1
while i < 101:
x = i % 15
y = i % 5
z = i % 3
if x == 0:
print('FizzBuzz')
elif y == 0:
print('Buzz')
elif z == 0:
print('Fizz')
else:
print(i)
i += 1 |
0839a18fd25980bc8d0e31d8d6bcb2652ddb7e9a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/ravi_g/lesson08/test_circle.py | 1,775 | 3.984375 | 4 | #!/usr/bin/env python3
# Testing circle.py
import math
import circle as cir
def test_check_rad_diameter():
'''
checks radius and diameter
'''
# initialized with radius 5
c1 = cir.Circle(5)
assert c1.radius == 5
assert c1.diameter == 10
# Set diameter
c2 = cir.Circle()
c2.diam... |
e34adea7c5453c8145944bfbe6207f8b4801cda8 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kimc05/Lesson03/Slicing_lab.py | 1,338 | 3.9375 | 4 | #sequence to test
a_string = "this is a string"
a_tuple = (2, 54, 13, 12, 5, 32)
#function: first and last items exchanged
def exchange_first_last(seq):
return seq[-1:] + seq[1:-1] + seq[:1]
#function: every other item removed removed
def alternate_removed(seq):
return seq[::2]
#function: first 4 and last 4 ... |
c52e6d2994df1d12a3581a59b1c5a97098d261ed | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jack_anderson/lesson07/html_render.py | 3,424 | 3.96875 | 4 | #!/usr/bin/env python3
"""
Jack Anderson
03/01/2020
UW PY210
Lesson 07
A class-based system for rendering html.
"""
# This is the framework for the base class
class Element(object):
indent = " "
tag = "html"
def __init__(self, content=None, **kwargs):
self.attribs = dict()
for k, v ... |
300cda2ca8204637ec2033f13f77a35248daa77a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jason_jenkins/lesson01/Logic1.py | 1,393 | 3.859375 | 4 | # Lesson 1: Logic1
def cigar_party(cigars, is_weekend):
if(is_weekend and cigars >= 40):
return True
return 40 <= cigars <= 60
def date_fashion(you, date):
if you <= 2 or date <= 2:
return 0
elif you >= 8 or date >= 8:
return 2
else:
return 1
def squirrel_play(tem... |
0ff876263cb8c9e951002b8af261cea3bae6f2ae | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/steve-long/lesson01-enviro/activities-exercises/task-2-puzzles/warmup1.py | 7,721 | 3.859375 | 4 | # Python210 | Fall 2020
# ----------------------------------------------------------------------------------------
# Lesson01
# Task 2: Puzzles (http://codingbat.com/python) (warmup1.py)
# Steve Long 2020-09-10
# /Users/steve/Documents/Project/python/uw_class/python210/lessons/lesson01-enviro/warmup1.py
# sleep_in
#... |
b5087ee763fb01617c05bfd67ce8185e5f316df5 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/CCSt130/lesson02/has22.py | 2,601 | 3.984375 | 4 | # -*- coding: utf-8 -*-
"""
This code generates a 1000 element tuple then compares
element[n] with element[n+1] to see if there is a match between
those elements and a constant.
"""
"""
Lesson02 :: Has22
CodingBat Exercise
@author: Chuck Stevens :: CCSt130
Created on Sun Jun 30 21:11:21 2019
"""
import random
def ... |
75c0efba3ab9de62cd3d2e403cc2e5a5bf43d349 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/chieu_quach/lesson03/strformat_lab.py | 3,327 | 4.1875 | 4 |
# Author : Chieu Quach
# Assignment: Lesson03
# Exercise : String Formating Exercise
# =============================================
# task 1
def task1():
global file, floatnum, scienum2, scienum3
print ("task 1 ")
fnames = [2, 123.4567, 10000, 12345.67]
lenfnames = len(fnames)
# ... |
78e78152e2e82208a5f0c7b00a90872aad763734 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/kristoffer_jonson/lesson3/slicing_lab.py | 2,089 | 4.03125 | 4 | def exchange_first_last(seq):
"""
Return sequence with first and last element flipped
:param seq: Requested sequence to be flipped
"""
return seq[-1:] + seq[1:-1] + seq[:1]
def remove_every_other(seq):
"""
Return sequence with every other element removed. Retains first element.
:param ... |
c5cd6c1e7aec35f549bacc299f97f63741e28af3 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/mgummel/lesson01/count_evens.py | 142 | 3.765625 | 4 | def count_evens(nums):
count_variable = 0
for element in nums:
if element % 2 == 0:
count_variable += 1
return count_variable
|
06f63a74a86fe81d9f34848ac9ebc83fc3508883 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/anthony_mckeever/lesson3/exercise_2/strformat_lab.py | 11,445 | 4.28125 | 4 | """
Programming In Python - Lesson 3 Exercise 2: StrFormat Lab
Code Poet: Anthony McKeever
Start Date: 07/29/2019
End Date: 07/30/2019
"""
def format_sequence(seq):
"""
Return a string that contains the contents of a sequence. Each item will be formatted as following:
seq[0] : Will be padded with up to 2 ... |
d385be11e4209ddf75fd6aad6a051e0c886d200b | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/calvin_fannin/lesson04/katafourteen.py | 2,195 | 3.953125 | 4 | #!/usr/bin/env python3
import sys
import os
import random
import string
def build_trigrams(words):
"""
build up the trigrams dict from the list of words
returns a dict with:
keys: word pairs
values: list of followers
"""
trigrams = {}
for i in range(len(words)-2):
pair =... |
d526c9b6894043043b1069120492a35ea443d20d | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Deniss_Semcovs/Lesson04/dict_lab.py | 1,906 | 4.15625 | 4 | #!/usr/bin/env python3
#Create a dictionary
print("Dictionaries 1")
dValues = {
"name":"Cris",
"city":"Seattle",
"cake":"Chocolate"
}
print(dValues)
#Delete the entry
print("Deleting entery for 'city'")
if "city" in dValues:
del dValues["city"]
print(dValues)
#Add an entry
print("Adding a new item")
dValues.upd... |
ec4b2731e8b0313c92982e103f90dd6add95c020 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/stan_slov7/lesson05/mailroom3.py | 9,868 | 3.765625 | 4 | #!/usr/bin/env python3
#+-----------------------------------------+
#| Mailroom Part 3 - Assign #4 of Lesson 5 |
#+-----------------------------------------+
import sys, os.path
donor_dict = {'Jeff Bridges' : [1309.45, 7492.32],
'Alice Summers' : [3178.67, 9823.00],
'Henry Cavill' : ... |
e878fd49b17b152e93fd91f6cfc88178b97fbf29 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/will_chang/lesson03/slicing_lab.py | 2,639 | 4.3125 | 4 | def exchange_first_last(seq):
"""Returns a copy of the given sequence with the first and last values swapped."""
if(len(seq) == 1): #Prevents duplicates if sequence only has one value.
seq_copy = seq[:]
else:
seq_copy = seq[-1:]+seq[1:-1]+seq[:1]
return seq_copy
def exchange_ev... |
8ef5de28cc8dd558168a02d1bac9c33727337527 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/jacob_daylong/Lesson 8/circle.py | 1,187 | 4.09375 | 4 | import math
class Circle(object):
def __init__(self, radius):
self.radius = radius
@property
def area(self):
return (self.radius ** 2) * math.pi
@property
def diameter(self):
return self.radius * 2
@diameter.setter
def diameter(self, diameter):
self.radiu... |
5fdd8e8217317417bb9e5494433ce7d7db8998d7 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/Steven/lesson03/slicing.py | 2,184 | 4.5 | 4 | #! bin/user/env python3
'''
Write some functions that take a sequence as an argument, and return a copy of that sequence:
* with the first and last items exchanged.
* with every other item removed.
* with the first 4 and the last 4 items removed, and then every other item in the remaining sequence.
* with the elements... |
65a1ee2bf6c0b2a1bf3217a82ab9450bef14e56f | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/zach_meves/lesson08/test_circle.py | 10,536 | 4.125 | 4 | """
Test circle.py
"""
import unittest
import os
from circle import *
import math
class TestCircle(unittest.TestCase):
"""Tests the Circle class."""
def setUp(self) -> None:
self.c1 = Circle(1)
self.c2 = Circle(1.5)
def test_init(self):
"""Test constructor."""
c = Circle... |
3235b564b73ebaec5685d52174b8859e04d7b30a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/nick_miller/lesson01/codingbat-pushups/makes10.py | 267 | 3.875 | 4 | #!/usr/bin/env python
def makes10(a, b):
# if a == 10 or b == 10:
# return True
# if a + b == 10:
# return True
# else:
# return False
#
# shortens to:
return a == 10 or b == 10 or a + b == 10
|
2046b6e7f934c35cca4307316e6dcc0a36ad023a | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/grant_dowell/in_work/dict_lab.py | 974 | 3.546875 | 4 | #!/user/bin/env/ python3
"""
Created on Thu Jan 23 18:21:24 2020
@author: Grant Dowell
Dictionary and Set Lab
"""
dict_1 = {"name":"Chris", "city":"Seattle", "cake":"Chocolate"}
print(dict_1)
dict_1.pop("cake")
print(dict_1)
dict_1["fruit"] = "Mango"
print(dict_1)
print(dict_1.keys())
print(dict_1.values())
print(... |
bc451f5e451696d92d005cf465993681ed70f4ae | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/tim_lurvey/lesson02/2.4_series.py | 2,205 | 4.34375 | 4 | #!/usr/bin/env python
__author__ = 'Timothy Lurvey'
import sys
def sum_series(n, primer=(0, 1)):
"""This function returns the nth values in an lucas sequence where n is sum of the two previous terms.
:param n: nth value to be returned from the sequence
:type n: int
:param prime... |
ffcb1580b89f4c833ed2fda7c8628534b7724c6b | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/bplanica/codingbat.py | 3,424 | 3.828125 | 4 | # ------------------------- #
# Breeanna Planica
# Cosingbat.com exercises for Lesson 1 - Python 210
# Warmup-1 and Warmup-2 exercises
#
# https://codingbat.com/python
# ------------------------- #
# Warmup-1 > sleep_in
def sleep_in(weekday, vacation):
if not weekday or vacation:
return True
else:
return F... |
3e99ca23f0cb352898de2c6d948857e7d19c4648 | UWPCE-PythonCert-ClassRepos/SP_Online_PY210 | /students/mitch334/lesson04/dict_lab.py | 2,131 | 4.3125 | 4 | """Lesson 04 | Dictionary and Set Lab"""
# Goal: Learn the basic ins and outs of Python dictionaries and sets.
#
# When the script is run, it should accomplish the following four series of actions:
#!/usr/bin/env python3
# Dictionaries 1
# Create a dictionary containing “name”, “city”, and “cake” for “Chris” from “Se... |
4120831e3897b34117d4b84f73ff8edb67254e40 | DeadlyShanx/CTI110 | /Celsius to Fahrenheit Table Python.py | 246 | 3.640625 | 4 | # Celsius to Fahrenheit Table
# Date
# CTI-110 P4HW2 - Celsius to Fahrenheit Table
# Johnson
#
print('Celsius/Fahrenheit')
for Celsius in range(21):
fahrenheit=(9/5)*Celsius+32
print(Celsius,'=',format(fahrenheit,'.2f'))
|
fcbc5f5f1d5748360214967bcbbc42c01a7f0779 | guipzaia/python-game | /campo.py | 3,361 | 3.546875 | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Bibliotecas Padrão
import random
# Bibliotecas Personalizadas
import printer
import constantes as c
from snake import Snake
# Classe Campo (extends Printer)
class Campo(printer.Printer):
# Construtor da classe
def __init__(self):
# Atributos da classe
self.data... |
7139d6e1cb237fcaa2fe0b432ba202af37d4a2c7 | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista02/ex04.py | 225 | 3.84375 | 4 | teclado = input("Digite o primeiro numero: ")
num1 = int(teclado)
teclado = input("Digite o segundo numero: ")
num2 = int(teclado)
potencia = num1 ** num2
potenciar = str(potencia)
print("O resultado final e: " + potenciar) |
f13effc92744a67522b672cc4bea0b23b1cb2ed6 | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista02/Ex08.py | 263 | 3.78125 | 4 | teclado = input("Digite o valor do prduto (R$): ")
produto = float(teclado)
teclado = input("Digite o valor do desconto (%): ")
desconto = float(teclado)
valorDesconto = produto - (produto * (desconto / 100))
print("O valor com desconto é: R$",valorDesconto,)
|
661f76129e30e8f780dd51f72b0e76e90477e7ba | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista03/Ex10.py | 402 | 3.796875 | 4 | import math
a = float(input("Digite o coeficiente a: "))
b = float(input("Digite o coeficiente b: "))
c = float(input("Digite o coeficiente c: "))
delta = ((b * b) - ((4 * a) * c))
if delta < 0:
delta = delta * -1
rdelta = math.sqrt(delta)
x1 = ((b * -1) + rdelta) / (2 * a)
x2 = ((b * -1) - rdelta) / (2 * a)
pri... |
99676f9a08690f1a09fecb838acafe1f8f6dd812 | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista02/Ex11.py | 212 | 3.5625 | 4 | teclado = input("Digite o seu RM(5 numeros): ")
rm = int(teclado)
num1 = rm % 10
num2 = num1 % 10
num3 = num2 % 10
num4 = num3 % 10
num5 = num4 % 10
resultado = num1 + num2 + num3 + num4 + num5
print(resultado) |
5f212320614a24dbc1e59dcc0d46895778ac1307 | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista03/Ex11.py | 1,136 | 3.90625 | 4 | produto = float(input("Digite o valor da etiqueta do produto(R$): "))
tipoPagamento = int(input("Seleciona a forma de pagamento:1-Débito, 2-Crédito, 3-Cheque, 4-Dinheiro: "))
if tipoPagamento < 1 and tipoPagamento > 4:
print("Forma de pagamento invalida")
elif tipoPagamento == 1 or tipoPagamento == 3 or tipoPagamen... |
2bfc44ed603cc4ff70fef4e524918ef13944094d | lucas-cavalcanti-ads/projetos-fiap | /1ANO/PYTHON/ListaExercicios/Lista03/Ex13.py | 600 | 4.125 | 4 | from datetime import date
print("Bem vindo ao programa de informacao de datas")
hoje = date.today()
print("Voce está executando esse programa em:",hoje.day,"/",hoje.month,"/",hoje.year)
dia = int(input("Digite o dia de hoje(Ex:22, 09): "))
mes = int(input("Digite o mes de hoje(Ex:07, 12): "))
ano = int(input("Digite o ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.