CapnDom
@CapnDom
0
calculator-startWant to join the course? Start your journey here:
https://100daysofpython.dev/
Why does the "or" operator not work as I want?
New to coding, still just learning.
My program continuously loops at line 14 for some reason. I know it's ugly code, but I just try to make it work and then tidy up later. Still not sure why the "or" operator doesn't work?
Can you explain to me what's wrong?0
1
0
0
blind-auction-startWant to join the course? Start your journey here:
https://100daysofpython.dev/
How do I get the values from a dictionary inside a list?
How do I iterate through a dictionary nested in a list and compare the values to each other and then print out the highest bidder?
I am an absolute beginner and I have more problems with syntax than I have with the logic behind things - but this time I think it's both.
How do I get into the dictionary entry inside the list and read the value, compare it and get the highest bidder out?
The idea was to somehow read it and safe the highest bidder in a variable but this variable needs to include the name and the amount bid, too.
I try for two hours now and the course has a completely different solution that is nice and all but won't help me learn about my approach.
Any ideas? Sorry if this is very basic, we all started somewhere though.1
1
0
I think it could be a lot shorter, I just don't see how. It works and does what it should, but that doesn't satisfy me.
I'm open for advice.
PS: I f
Python
Spacecraft import random
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
numbers = '0123456789'
symbols = '!#$%&()*+'
password =[]
print("Welcome to the PyPassword Generator!")
nr_letters= int(input("How many letters would you like in your password?\n"))
nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_numbers = int(input(f"How many numbers would you like?\n"))
for i in range(nr_letters):
password += random.choice(letters)
for i in range(nr_symbols):
password +=1 year ago
The solution is different than my approach, and I would like to get mine running. Any pointers? I think I look at it for so long I won't be able to se
Python
I am trying to do a course, and the solution is entirely different than this. Where is it going wrong? Any pointers? 2400 should be a leap year, but i
Python
SixBeeps Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400
In a structured list-like form:
The year is divisible by 4:
The year is divisible by 100:
The year is divisible by 400: YES
Otherwise: NO
Otherwise: YES
Otherwise: NO
What you have right how is:
The year is divisible by 4:
The year is ALMOST divisible by 100: YES
The year is divisible by 401 year ago
It does calculate without any error messages, but if I type my age (24) and then take the weeks (4392 weeks) and turn them into years, then it will ad
Python
So I am fairly new to coding in general, this is but my second repl, but I am stumped. I look at it for such a long time now I just feel stuck.
Whene
Python
MikeW3 computer_choice is the LIST of choices, but you expect it to be the choice chosen
The actual choice the computer picked is lost due to it being only in the print statement and not saved as a variable1 year ago
I have written this little bit of code, I am entirely new and just tried a few things out. I played around with input, and then I moved on to else if
Python
SixBeeps That says indent, not intend. It means you indented your code wrong (indentation is the spaces/tabs you put in front of a line of code). In this case, the if statement on line 9 has one too many spaces. Remove one and it'll run.1 year ago