PYTHONICAI Telegram 1083
Python 3.9 got released and it comes with new cool features:

1. Dictionary union:

a = {1: 'a', 2: 'b', 3: 'c'}
b = {4: 'd', 5: 'e'}
c = a | b
print(c)

[Out]: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}

2. Type hinting. Allows you to write:

def sum_dict(var: dict[str, int]) -> int:
return sum(var[key] for key in var)

3. New string methods. Two new string methods for removing prefixes and suffixes have been added.

"Hello world".removeprefix("He")

[Out]: "llo world"

4. Python 3.9 uses a new parser, based on PEG instead of LL(1). Python users are not affected, but parser improvements would help to develop new language features faster.

Link

#python

@pythonicAi



tgoop.com/pythonicAI/1083
Create:
Last Update:

Python 3.9 got released and it comes with new cool features:

1. Dictionary union:

a = {1: 'a', 2: 'b', 3: 'c'}
b = {4: 'd', 5: 'e'}
c = a | b
print(c)

[Out]: {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}

2. Type hinting. Allows you to write:

def sum_dict(var: dict[str, int]) -> int:
return sum(var[key] for key in var)

3. New string methods. Two new string methods for removing prefixes and suffixes have been added.

"Hello world".removeprefix("He")

[Out]: "llo world"

4. Python 3.9 uses a new parser, based on PEG instead of LL(1). Python users are not affected, but parser improvements would help to develop new language features faster.

Link

#python

@pythonicAi

BY Pythonic AI


Share with your friend now:
tgoop.com/pythonicAI/1083

View MORE
Open in Telegram


Telegram News

Date: |

How to Create a Private or Public Channel on Telegram? 4How to customize a Telegram channel? fire bomb molotov November 18 Dylan Hollingsworth yau ma tei Don’t publish new content at nighttime. Since not all users disable notifications for the night, you risk inadvertently disturbing them. During a meeting with the president of the Supreme Electoral Court (TSE) on June 6, Telegram's Vice President Ilya Perekopsky announced the initiatives. According to the executive, Brazil is the first country in the world where Telegram is introducing the features, which could be expanded to other countries facing threats to democracy through the dissemination of false content.
from us


Telegram Pythonic AI
FROM American