Jump to content

Bryan 2760

Member
  • Posts

    36
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Bryan 2760's Achievements

  1. I also should mention i have an HDD, am i still able to use that? I have 3 different type of storage now and im overwhelmed!!
  2. Ok cool! how would you recommend i store my stuff? Should I do windows in the M.2 and everything else on my ssd?
  3. Hello everyone, So for my birthday, my brother got me the samsung 970 evo 500gb M.2 and I have been using the 500gb ssd. Since I have this new memory, is my old ssd useless to me now? I was wondering if I can use both or have another use for it? Thanks!
  4. Hello everyone! I have created a program that is supposed to read files. All the codes are correct, but I'm just getting an error that it can't find a file. I create a simple txt file using notepad and saving it. I am still getting errors it cant find it but I know its there. Can someone help me? Thanks! fname = input("Enter the name of the file:") infile = open(fname, "r") lines = 0 words = 0 characters = 0 for line in infile: wordslist = line.split() lines = lines + 1 words = words + len(wordslist) characters = characters + len(line) print(lines) print(words) print(characters) THIS IS THE ERROR IM GETTING WHEN RUNNING IT BELOW: Enter the name of the file:lamb Traceback (most recent call last): File "C:\Users\Bryan\AppData\Local\Programs\Python\Python38\HW extra credit #1.py", line 2, in <module> infile = open(fname, "r") FileNotFoundError: [Errno 2] No such file or directory: 'lamb' >>> RESTART: C:\Users\Bryan\AppData\Local\Programs\Python\Python38\HW extra credit #1.py Enter the name of the file:lamb.txt Traceback (most recent call last): File "C:\Users\Bryan\AppData\Local\Programs\Python\Python38\HW extra credit #1.py", line 2, in <module> infile = open(fname, "r") FileNotFoundError: [Errno 2] No such file or directory: 'lamb.txt'
  5. omg thank you so much! it works
  6. wait jk i think i fixed the totallodging now its giving me problems for totaldinner
  7. infile = open("partslist.txt","r") totalDinner = 0 totalLodging = 0 line = infile.readline() while line != "": partslist = line.split(";") category = partslist[1] amount = partslist[2] if category == "dinner": totalDinner = totalDinner + amount if category == "Lodging": totalLodging = totalLodging + amount line = infile.readline() print ("Dinner:",totalDinner) print ("Lodging:",totalLodging) infile.close() ok so i did it like this and now its saying Traceback (most recent call last): File "C:/Users/Bryan/Desktop/hw 3 # 3.py", line 12, in <module> totalLodging = totalLodging + amount TypeError: unsupported operand type(s) for +: 'int' and 'str'
  8. how come i didnt have problem with the totalDinner then? it skip it and told me the total lodging is wrong?
  9. infile = open("partslist.txt","r") dinner = 0 lodge = 0 line = infile.readline() while line != "": partslist = line.split(";") category = partslist[1] amount = partslist[2] if category == "dinner": totalDinner = totalDinner + amount if category == "Lodging": totalLodging = totalLodging + amount line = infile.readline() print ("Dinner:",totalDinner) print ("Lodging:",totalLodging) infile.close() can someone tell me why its telling me that totalLodging is not define? Thank you
  10. you both are very helpful, but is there a way i can fix my code? it would help me understand a lot better if I knew what i did wrong or what i am missing!
  11. its not working :l thanks for the suggestion though
  12. Hi everyone, I am doing some python hw and i can seem to figure out what is wrong with my code. I cant seem to get it work. the question. can someone tell me what im missing? thank you 1. Translate the following pseudocode into a Python program for finding the minimum value and prints it from a set of inputs. Keep asking user for a number until they enter a sentinel value, storing the number if it’s lower than the number already stored. When a sentinel value is entered, the program stops. 5 pts Input value Set a Boolean variable “first” to true While input value not equal to sentinel value If first is true Set the minimum to the value. Set first to false. Else if the value is less than the minimum Set the minimum to the value Input value Print the minimum a) Your code with comments b) A screenshot of the execution Test Cases: 15, 12, 4, 2, 22, -1 (should print “the smallest number is 2”)
  13. Hello everyone, should i be worried that there are gaps between the metal gpu brackets? i would think it would create more dust inside my computer. Should i cover it up with something?
×