Azerbaijan Python Users Group
Eslinde o imis
"SQLAlchemy represents database sequences using the Sequence
object, which is considered to be a special case of “column default”. It only has an effect on databases which have explicit support for sequences, which among SQLAlchemy’s included dialects includes PostgreSQL, Oracle, MS SQL Server, and MariaDB. The Sequence
object is otherwise ignored."
Deyil. Bu sqlalchemy dən gələn Sequence type dır
Читать полностью…Salam, SQLAlchemy v2.0dan sonra gələn yeniliklər haqqında məsləhətlər almaq istəyirdim. Birinci sual list vs Sequence fərqlləridi. query həmişə Sequence göndərir və list return type mypy da fail olur. Burda hansı cür addımlar atmaq daha yaxşıdı ümumi olaraq təcrübələri eşitmək istəyərəm. Tam detallı bir fərqlərini izah edən məqalə tapa bilmədim düzü.
Digər bir məqam isə get_one() və ya normal select scalars ilə çəkməkdir. get_one() type of Sqlalchemy model qaytarır amma digər isə normal ORM model ve buda mypy da fail olur. Sqlalchemy v2 ilə işləyən və bu məqamlarla bağlı detallı məlumatı olan varsa bölüşsə sevinərəm.
Təşəkkür edirəm amma mən yazdığımda səhv nədədir? Mənə düzgün həll lazım deyil səhvimi başa düşmək isteyirem
Читать полностью…def fibonacciModified(t1, t2, n):
for i in range(3, n + 1):
t1, t2 = t2, t1 + t2**2
return t2
def fibonacciModified(t1, t2, n):
if n == 1:
yield t1
elif n == 2:
yield t2
else:
yield from fibonacciModified(t2, t1 + t2**2, n - 1)
result = list(fibonacciModified(t1, t2, n))[-1]
burdan bu suala baxdim amma yene 3 case runtime error aldim
Читать полностью…teshekkurler. Paralel hackerrank-da da hell edirem amma ance python-a uygun olanlari. Problem solving-den hec ne etmemishem heleki
Читать полностью…stepik.org-da oyrenirem.cox gozel izah edirler
Читать полностью…birinci double for loop menasizdi cunki (orda cox uzun list yaranir). sonra hemin listden bir nece defe ancaq 1ci herfi yoxlanilir ( ikinci for loop)
def minion_game(string):
# your code goes here
vowels = ['a', 'e', 'i', 'o', 'u']
kevin=0
stuart=0
for i in range(len(string)):
if s[i].lower() in (vowels):
kevin+=1*(len(string)-i)
else:
stuart+=1*(len(string)-i)
if kevin==stuart:
print('Draw')
elif kevin>stuart:
print('Kevin',kevin)
else:
print('Stuart',stuart)
https://realpython.com/introduction-to-python-generators/
Читать полностью…Sequence = _alias(collections.abc.Sequence, 1)
Bu Sequence Postgre-deki sequence ile eynidir ? https://www.postgresql.org/docs/current/sql-createsequence.html
Читать полностью…Yenidən avtomatik video düzəldən bot hazırladım. Bu səfər prosses daha basic olduğu üçün open source etmək qərarına gəldim:
https://www.linkedin.com/posts/alifagha-salmanov_my-latest-open-source-project-reels-generator-activity-7216762461557784578-SH6d?utm_source=share&utm_medium=member_desktop
sehv yoxdur, orda men basha dushduyume gore 3 test fail olur o da value errora goredi.
Читать полностью…value error'u hell etmek ucun
import sysЧитать полностью…
sys.set_int_max_str_digits(1000000)
#!/bin/python3Читать полностью…
import math
import os
import random
import re
import sys
#
# Complete the 'fibonacciModified' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER t1
# 2. INTEGER t2
# 3. INTEGER n
#
def fibonacciModified(t1, t2, n):
# Write your code here
if n>=3 and n<=20:
for i in range(2,n) :
(t2,t1)=(t1,t2)
t2=t2+t1**2
return t2
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
first_multiple_input = input().rstrip().split()
t1 = int(first_multiple_input[0])
t2 = int(first_multiple_input[1])
n = int(first_multiple_input[2])
result = fibonacciModified(t1, t2, n)
fptr.write(str(result) + '\n')
fptr.close()
https://www.hackerrank.com/domains/algorithms?filters%5Bsubdomains%5D%5B%5D=dynamic-programming
Bu algorithm'leri Bawa duwmek ucun komek ede biler
Bele teze bashlayanlar ucun praktika kimi leetcode( https://leetcode.com/problemset/all-code-essentials/ ) meslehet gorerdim.
Читать полностью…https://www.youtube.com/watch?v=JasPrZqImxo
Читать полностью…umumiyyetle, yield ile ejdaha sohbetler etmek olar. DontUseThisCode (MUELLIM) tutoriali var, amma advanced sohbetlerdir
Читать полностью…https://www.youtube.com/watch?v=u3T7hmLthUU
Читать полностью…https://www.youtube.com/watch?v=bD05uGo_sVI&pp=ygURZ2VuZXJhdG9ycyBweXRob24%3D
Читать полностью…Yeni başlamışam, link ata bilərsiz oxuyum həmin linkdən?
Читать полностью…generatorlara kecmek olar, buna lazy calculation lazimdir.
Читать полностью…