mirror of
https://github.com/JonasunderscoreJones/turbo-octo-potato.git
synced 2025-10-24 10:39:19 +02:00
Fixed Deadspaces
Removed all deadspaces
This commit is contained in:
parent
6d2ece92ee
commit
1478ec58ad
1 changed files with 5 additions and 5 deletions
10
linesum.py
10
linesum.py
|
|
@ -5,10 +5,10 @@ def convert_time_to_seconds(time_str):
|
|||
# Convert each part to an integer
|
||||
minutes = int(time_parts[0])
|
||||
seconds = int(time_parts[1])
|
||||
|
||||
|
||||
# Calculate the total time in seconds
|
||||
total_seconds = minutes * 60 + seconds
|
||||
|
||||
|
||||
return total_seconds
|
||||
|
||||
|
||||
|
|
@ -19,18 +19,18 @@ with open(input_file, 'r') as file:
|
|||
for line in file:
|
||||
line_parts = line.strip().split(':::')
|
||||
print(line_parts)
|
||||
|
||||
|
||||
# Extract the relevant information
|
||||
avg_track_length = line_parts[6]
|
||||
play_count = int(line_parts[3])
|
||||
|
||||
|
||||
if avg_track_length == 'NaN:NaN':
|
||||
# Use 3 minutes and 30 seconds (3:30) as the default track length
|
||||
track_length_seconds = convert_time_to_seconds('0:03:30')
|
||||
else:
|
||||
# Convert average track length to seconds
|
||||
track_length_seconds = convert_time_to_seconds(avg_track_length)
|
||||
|
||||
|
||||
# Calculate the product and add it to the total
|
||||
product = track_length_seconds * play_count
|
||||
total_product += product
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue