Posts

Showing posts from June, 2024

Module 6 4930

Daniel Tafmizi Dr. Friedman Lis 4930 June 24, 2024 Module 6 GitHub link:  DanielDataGit/lis4930 (github.com) Comments: I did not run into much trouble completing the assignment questions. I did not rely on google as much as some of the previous assignments. The datetime module was easy to use. Questions: I was confused with what the first question asked. Did I answer it correctly? Can you use logical operators with datetime to subset data from a list?  from datetime import datetime from datetime import timedelta import sys for line in sys.stdin: data = line.strip().split( " \t " ) if len (data) == 6 : date, time, store, item, cost, payment = data # create local datetime object date_time = datetime.now() print ( "{0} \t {1} \t {2}" .format(item, cost, date_time)) # Add 1 day time1 = datetime.now() + timedelta( days = 1 ) print (time1) # Subtract 60 seconds from prior time2 = time1 - timedelta( seconds = 60 ) print (time2) # Add

Module 5 4930

Daniel Tafmizi Dr. Friedman Lis 4930 June 17, 2024 Module 5 GitHub link:  DanielDataGit/lis4930 (github.com) Comments: This is my first time using the class object maker. I see how this can be used to create efficient and reproducible objects. I appreciate the way python classes are constructed and customized. Furthermore, I am starting to enjoy using the pycharm IDE. At first, I had difficulty using the applications features, but I have become more nuanced towards them. The IDE's autocomplete helped me a few times in this assignment. Question: Is it respected to use the "posn" name as a local name in my functions? I re-used the name in my create and offset functions.  # module 5 assignment class Rectangle: """ A class to manufacture rectangle objects """ def __init__ ( self , posn, w, h): """ Initialize rectangle at posn, with width w, height h """ self .corner = posn self .width

Module 4 4930

Daniel Tafmizi Dr. Friedman Lis 4930 June 10, 2024 Module 4 GitHub link:  DanielDataGit/lis4930 (github.com) Comments: I enjoyed going back to my algebra days. It has been a while since I reviewed quadratic equations and had to do some googling. Overall, I did not run into much trouble with the prompts. For the second question I kept putting x/y instead of x/n, but I resolved the issue after some mental focusing.  Question: How can I prevent the "none" at the end of the incDenominator script? I resolved the issue. I was printing a print. import math def quadraticroots (a, b, c): # calculate discriminant discriminant = b ** 2 - 4 * a * c # plus minus sign fancysym = u" \u00B1 " # calculates roots based off of discriminant if discriminant > 0 : print ( f"The roots are: { (-b + math.sqrt(discriminant)) / ( 2 * a) } , { (-b - math.sqrt(discriminant)) / ( 2 * a) } " ) elif discriminant == 0 : print ( f"The ro