✨ Python for Loops: The Pythonic Way ✨
📖 Learn how to use Python for loops to iterate over lists, tuples, strings, and dictionaries with Pythonic looping techniques.
🏷️ #intermediate #best-practices #python
📖 Learn how to use Python for loops to iterate over lists, tuples, strings, and dictionaries with Pythonic looping techniques.
🏷️ #intermediate #best-practices #python
❤2
Python tip
Adding an element to the end of a list
If you need to efficiently add elements from both ends, use
https://t.iss.one/DataScience4
Adding an element to the end of a list
(list.append) works in O(1), but inserting in the middle of the list is O(n) because elements need to be shiftedIf you need to efficiently add elements from both ends, use
collections.deque — there operations on the edges have complexity O(1)https://t.iss.one/DataScience4
Forwarded from ADMINOTEKA
This media is not supported in your browser
VIEW IN TELEGRAM
Весна близко, а значит, самое время просыпаться от зимней спячки, радоваться солнцу и… запускать рекламу, которая реально работает 🔥
Мы решили разбудить твой канал по-настоящему и разыграть 3 сертификата на 10 000 охватов каждому победителю — сотни проверенных каналов из различных лиг репостнут любой указанный тобой пост
Как участвовать:
✅ подписаться на 🅰 ️Adminoteka
✅ забустить канал по ссылке https://t.iss.one/boost/adm1noteka
2 марта рандомно выберем трёх счастливчиков. Весна официально начинается🌸
Мы решили разбудить твой канал по-настоящему и разыграть 3 сертификата на 10 000 охватов каждому победителю — сотни проверенных каналов из различных лиг репостнут любой указанный тобой пост
Как участвовать:
2 марта рандомно выберем трёх счастливчиков. Весна официально начинается
Please open Telegram to view this post
VIEW IN TELEGRAM
A bit of basics. Day 3: Calendar in Python
There is a built-in module in Python called
Let's say we want to see the calendar for April 2022. We use the
There are many other things you can do with
👉 https://t.iss.one/DataScience4
There is a built-in module in Python called
calendar. We can import this module to display the calendar. There are many things you can do with the calendar.Let's say we want to see the calendar for April 2022. We use the
month class from the calendar module and pass the year and month as arguments. See below:import calendar
month = calendar.month(2022, 4)
print(month)
There are many other things you can do with
calendar. For example, you can use it to check whether a given year is a leap year or not. Let's check if 2022 is a leap year.import calendar
month = calendar.isleap(2022)
print(month)
FalsePlease open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Code With Python
This channel delivers clear, practical content for developers, covering Python, Django, Data Structures, Algorithms, and DSA – perfect for learning, coding, and mastering key programming skills.
Admin: @HusseinSheikho || @Hussein_Sheikho
Admin: @HusseinSheikho || @Hussein_Sheikho
❤3
✨ How to Use the OpenRouter API to Access Multiple AI Models via Python ✨
📖 Access models from popular AI providers in Python through OpenRouter's unified API with smart routing, fallbacks, and cost controls.
🏷️ #intermediate #ai #api
📖 Access models from popular AI providers in Python through OpenRouter's unified API with smart routing, fallbacks, and cost controls.
🏷️ #intermediate #ai #api
❤1
A bit of Python basics. Day 4: Getting the current time and date
The code below shows how to get the current time using the
What if we want to return today's date? We can use
👉 https://t.iss.one/DataScience4
The code below shows how to get the current time using the
datetime module. The now() method returns a datetime object representing the current date and time according to the system clock. The strftime() method formats the time for the desired output. This code shows how to use the datetime module together with the strftime() method to get a formatted time string in the format of hours, minutes, and seconds.from datetime import datetime
time_now = datetime.now().strftime('%H:%M:%S')
print(f'Current time: {time_now}')
Current time: 17:37:28
What if we want to return today's date? We can use
date from the datetime module. Below, the today() method is used:from datetime import date
today_date = date.today()
print(today_date)
2023-09-20
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Code With Python
This channel delivers clear, practical content for developers, covering Python, Django, Data Structures, Algorithms, and DSA – perfect for learning, coding, and mastering key programming skills.
Admin: @HusseinSheikho || @Hussein_Sheikho
Admin: @HusseinSheikho || @Hussein_Sheikho
❤1
✨ graphical user interface (GUI) | Python Glossary ✨
📖 A visual way of interacting with a program through windows, buttons, and other on-screen elements.
🏷️ #Python
📖 A visual way of interacting with a program through windows, buttons, and other on-screen elements.
🏷️ #Python
❤2
✨ Gift Cards ✨
📖 Give the Gift of Real Python with a membership gift card. An easy way to give joy to the Pythonistas in your life.
🏷️ #Python
📖 Give the Gift of Real Python with a membership gift card. An easy way to give joy to the Pythonistas in your life.
🏷️ #Python
❤1
✨ Lovable | AI Coding Tools ✨
📖 An AI-powered full-stack platform that generates and deploys web applications from natural language descriptions.
🏷️ #Python
📖 An AI-powered full-stack platform that generates and deploys web applications from natural language descriptions.
🏷️ #Python
❤1
⚡️Бывший пиарщик Бургер Кинга, Кока-Колы и Тинькофф завёл свой телеграм-канал, где постит афигенную рекламу, и уничтожает брендов за зашкварную.
Ещё внутри мемы про маркетинг, SMM, и как сделать рекламу эффективной — даже если вы толком не шарите.
Это как 99 франков, только в России — тыц
Ещё внутри мемы про маркетинг, SMM, и как сделать рекламу эффективной — даже если вы толком не шарите.
Это как 99 франков, только в России — тыц
❤2
A bit of Python basics. Day 6 - Exchanging variable values
In Python, you can swap variables after they have already been assigned objects. Below, we first assign
You can also use the XOR (exclusive or) operator to swap variables. This is a three-step method. In the example below, we swap the values of
You can also use arithmetic operations (addition and subtraction) to swap variables without a temporary variable. However, this method is recommended for swapping numeric data types. Here's an example:
As a result of these arithmetic operations, the values of
This method of swapping variables without a temporary variable is based on the fact that when you add or subtract the value of one variable from another, you can effectively swap their values without the need for additional storage.
👉 https://t.iss.one/DataScience4
In Python, you can swap variables after they have already been assigned objects. Below, we first assign
20 to the variable x and 30 to the variable y, and then swap them: x becomes 30, and y becomes 20. This method is called tuple packing/unpacking.x, y = 20, 30
x, y = y, x
print('x is: ', x)
print('y is: ', y)
x is 30
y is 20You can also use the XOR (exclusive or) operator to swap variables. This is a three-step method. In the example below, we swap the values of
x and y.x = 20
y = 30
# step one
x ^= y
# step two
y ^= x
# step three
x ^= y
print(f'x is: {x}')
print(f'y is: {y}')
x is: 30
y is: 20You can also use arithmetic operations (addition and subtraction) to swap variables without a temporary variable. However, this method is recommended for swapping numeric data types. Here's an example:
# Use arithmetic operations
x = 5
y = 10
x = x + y
y = x - y
x = x - y
print("After swapping:")
print("x =", x)
print("y =", y)
After swapping:
x = 10
y = 5As a result of these arithmetic operations, the values of
x and y have actually been swapped. After the swap, x contains the original value of y (10), and y contains the original value of x (5).This method of swapping variables without a temporary variable is based on the fact that when you add or subtract the value of one variable from another, you can effectively swap their values without the need for additional storage.
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Code With Python
This channel delivers clear, practical content for developers, covering Python, Django, Data Structures, Algorithms, and DSA – perfect for learning, coding, and mastering key programming skills.
Admin: @HusseinSheikho || @Hussein_Sheikho
Admin: @HusseinSheikho || @Hussein_Sheikho
❤4
This channels is for Programmers, Coders, Software Engineers.
0️⃣ Python
1️⃣ Data Science
2️⃣ Machine Learning
3️⃣ Data Visualization
4️⃣ Artificial Intelligence
5️⃣ Data Analysis
6️⃣ Statistics
7️⃣ Deep Learning
8️⃣ programming Languages
✅ https://t.iss.one/addlist/8_rRW2scgfRhOTc0
✅ https://t.iss.one/Codeprogrammer
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2
✨ OpenCode | AI Coding Tools ✨
📖 An open-source terminal AI coding agent with support for over 75 AI models and IDE integrations.
🏷️ #Python
📖 An open-source terminal AI coding agent with support for over 75 AI models and IDE integrations.
🏷️ #Python
✨ Quiz: Dependency Management With Python Poetry ✨
📖 Test your knowledge of Python Poetry, from installation and virtual environments to lock files, dependency groups, and updates.
🏷️ #intermediate #best-practices #devops #tools
📖 Test your knowledge of Python Poetry, from installation and virtual environments to lock files, dependency groups, and updates.
🏷️ #intermediate #best-practices #devops #tools