Am adaugat materialele din săpt trecute.

This commit is contained in:
2026-03-27 21:15:27 +02:00
parent 16f3a6aaed
commit 84453a6456
23 changed files with 1634 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 18:28:22 2026
@author: alex
"""
import random
import pandas
bday_messages = ['Hope you have a very Happy Birthday! 🎈',
'It\'s your special day get out there and celebrate! 🎉',
'You were born and the world got better everybody wins! 🥳',
'Have lots of fun on your special day! 🎂',
'Another year of you going around the sun! 🌞'
]
bday_m = random.choice(bday_messages)
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 11 17:21:24 2026
@author: alex
"""
for bottles in range(99,0,-1):
print(f"{bottles} bottles of beer on the wall")
print(f"{bottles} bottles of beer")
print("Take one down, pass it around")
for i in range (1,101): #fizzbuzz
if (i%3==0 and i%5==0):
print("FizzBuzz")
elif (i%3==0):
print("Fizz")
elif (i%5==0):
print("Buzz")
else:
print(i)
def exp(a,b):
p = 1
if(b<1):
return p
else:
p *= exp(a,b)
b = b -1
print(exp(2,2))
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 18:27:40 2026
@author: alex
"""
import datetime, bday_messages
today = datetime.date(2026,3,21)
next_birthday = datetime.date(2026,5,13)
time_difference = next_birthday - today
if time_difference == 0:
print(bday_m)
else:
print(f"My next birthday is {time_difference} days away!")
@@ -0,0 +1,22 @@
class BankAccount:
def __init__(self, first_name, last_name, account_id, account_type, pin, balance):
self.first_name = first_name
self.last_name = last_name
self.account_id = account_id
self.account_type = account_type
self.pin = pin
self.balance = balance
def deposit(self, amount):
self.balance += amount
return self.balance
def withdraw(self, amount):
self.balance -= amount
return self.balance
def display_balance(self):
print(self.balance)
larry = BankAccount("Larry", "Smith" ,1, "debit", 1234, 0.)
larry.deposit(96)
larry.withdraw(25)
larry.display_balance()
@@ -0,0 +1,16 @@
import random
symbols = ['🍒', '🍇', '🍉', '7️⃣']
results = random.choices(symbols, k=3)
print(results[0] + "|" + results[1] + "|" + results[2])
sevens = False
for i in range(0, len(results)-1):
if results[i] == '7️⃣' and results[i+1] == '7️⃣':
sevens = True and sevens
else:
sevens = False
if sevens == True:
print("Jackpot!")
else:
print("Thanks for playing!")