#Python tip: Class patterns in structural pattern matching perform an isinstance() check. For an exact type match, add a guard:
match x:
case int() if type(x) is int:
print('exact int')
case str() if type(x) is str:
print('exact str')
for char in range(1, nr_letters 1):
password_list.append(random.choice(letters))
I found this to be the best way to randomize a list
letters = [# A-Z]
for char in range(1, nr_letters 1):
password_list.append(random.choice(letters))
got hung up with some personal stuff but now I am back picking up on day 5 of #100DaysOfCode
player_side = input()
random_side = random.randint(0, 1)
if player_side == 'Heads' and random_side == 1:
print('Heads. You win')
very simple, but a nice example of the randint function
i am on day 3 of #100DaysOfCode
feeling confident about my understanding of data types and how to integrate them cleanly into my programs
the tip calculator i made in yesterday’s lesson is very helpful to look back to when formatting and changing data types
Day-2 of #100DaysOfCode
Unstoppable learning of Python syntax datatypes, mathematical operation F strings and interactive coding exercise. After learning of two hours,I"m try 3 mini-projects of BMI Calculator,Life Weeks and Tips Calculator using Python. That Day is fantastic.