#off-topic-lounge-text

1 messages · Page 1 of 1 (latest)

stray current
#

Hi, there are some really informative youtube videos for beginners. Here is one video that might suit you https://www.youtube.com/watch?v=kqtD5dpn9C8

This Python tutorial for beginners show how to get started with Python quickly. Learn to code in 1 hour! Watch this tutorial get started!
👍 Subscribe for more Python tutorials like this: https://goo.gl/6PYaGF
🔥 Want to learn more? Watch my complete Python course: https://youtu.be/_uQrJ0TkZlc

📕 Get my FREE Python cheat sheet: http://bit.ly/2Gp8...

▶ Play video
grave stream
#

Introduction to Python Step by Step https://py4u.org/

fresh sail
#

@warm sonnet or over here.

#

Like over here.

timid fjordBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

warm sonnet
#

hi everyone

#

I can't really hear you, you voice is very low

#

@fresh sail

fresh sail
#

Is this any better?

warm sonnet
#

not really

#

its ok, but i got you on 200% volume xd

oak dagger
#

Thanks for you sharing, but your voice is too low.

hallow jay
#

yes

oak dagger
#

yes

#

I will just watching

hallow jay
#

I'm just here for the background sound :b

ruby plover
#

ussr

#

I am in ukraine fighting for russia atm.

oak dagger
#

Either is ok, it's just a character name from a cartoon

#

The octonauts

ruby plover
#

do you need to learn flask before you learn django?

#

and how do I learn about databases

fresh sail
silver warren
#

Thanks @grave stream

fresh sail
#

@worldly osprey

spiral nova
#

Sup guy's!

fresh sail
#

@unborn sorrel here

spiral nova
#

ggt guy's see ya later! XD

fresh sail
#

SilverHawks now on DVD: http://bit.ly/WAC_Hawks

For more on the Warner Archive visit: http://www.facebook.com/warnerarchive

Connect with Warner Bros. Entertainment Online:
Follow Warner Bros. Entertainment INSTAGRAM: https://www.instagram.com/warnerbrosentertainment/
Like Warner Bros. Entertainment on FACEBOOK: https://www.facebook.com/warner...

▶ Play video
undone vessel
#

mic prob ...

undone vessel
#

In computer programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in sequences of 24 bits that can be represented by four 6-bit Base64 digits.
Common to all binary-to-text encoding schemes, Base64 is designed to carry data stored in binary formats across channe...

snow crest
#

hi

#

can't hear the stream

#

no earlier the video

#

no

#

the video sound isn't audible

#

yes

#

now working

#

option 3

#

I think

#

x isn't defined

#

so maybe option 4 it is

#

can you show the vieo again I missed it

fresh sail
#

sure

snow crest
#

thanks

#

yes

#

y2 is none

#

all are none

#

I thought video has the initialization part

#

but it's just a que

#

in video x is string

#

3?

#

yes type

#

option 3

#

yeah! I was correct 1st time

#

great

fresh sail
harsh osprey
fresh sail
#

@vagrant portal show me your music! 👀

vagrant portal
#

Ok

#

I like the Python programing language too.😊

undone vessel
primal bison
#

Pls help

sturdy geyser
wintry quartz
#

Hi

cinder shell
#

lets go i struggled 3hours to get this XD

glass forum
#

Thanks @calm bay

calm bay
signal notch
#

hello @calm bay

#

i cant talk

#

im new to the server

#

just wanna ask advice.. im new to python which do you think i sbetter

#

i take cs50p or ATBS course?

#

okay thanks

#

see ya later man

fresh sail
worthy shore
#

yall see something wrong with this?

fresh sail
#

ok, sleepy sleepy time.

honest pasture
rich moss
#

incr a

#

a.incr()

grave ferry
#

guys anyone of you know web dev ??

#

needed some help

buoyant kestrel
jagged granite
#

@buoyant kestrel - Open the URL in a browser and check the console for errors

rich moss
tender tangle
carmine current
tender tangle
carmine current
rich moss
#

!pypi yeet

timid fjordBOT
tender tangle
shadow ivy
rich moss
#

i suppose await minaberry() will block forever

shadow ivy
#

oof

buoyant kestrel
vernal snow
#

@tender tangle 109448

shadow ivy
#

i know you did the new years/fireworks one too

delicate oar
#

yea that's me

shadow ivy
delicate oar
#

also me

shadow ivy
#

amazing

#

this too?

delicate oar
#

nope

delicate oar
#

I need to think of smth new for this year

shadow ivy
#

it's sooo nice

delicate oar
#

damn i looked at the pr and realized it's been a while

#

I got old

warped schooner
#

free hosting, can also use any domain

unkempt harness
#

I am also learning react rn

fringe latch
#

mr hemlock what are you working on

limpid coral
#

what im trying to describe was

#

I use konsole terminal emulator, which happens to also be KDE's deafult

#

but in konsole compared to for example gnome-terminal which works

#

if you run this code:

#
for r in range(0, 256):
    for g in range(0, 256):
        for b in range(0, 256):
            print(f"\033[38;2;{r};{g};{b}m ", end="")
#

in gnome-terminal it works. in konsole it doesnt.

#

this will render colored space characters in your terminal

#

so you must highlight them with your cursor to see

#

but in konsole, literally half of the colors turn out as grey

#

i don't know what the exact cause is

worthy shore
#

that's so satisfying

rich moss
#

!pypi nurses_2

timid fjordBOT
worthy shore
#

parralax is dope

calm bay
worthy shore
#

same here

#

our priorities are straight enough

#

they're not straight. but they're straight enough

glass forum
buoyant kestrel
#

!stream 336524160509411328

timid fjordBOT
#

✅ @proper cobalt can now stream until <t:1659115838:f>.

honest pasture
worthy shore
#

should i use flask or django for web dev with python?

buoyant kestrel
naive vector
#

floor = json["realEstate"]["properties"][0]["floor"]["value"]

buoyant kestrel
#

!code

timid fjordBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

strong willow
#
app.get("/teamSummary", async (req, res) => { // get the summary of a team.
    try {
        const args = parse(req)
        const team = await Repository.getTeamByTag(args.get("tagId"))

        assertVar(team, res)

        const highScores = await Repository.getTeamHighscores(team.id)
        team.highScores = highScores

        respond(res, 200, JSON.stringify(tagStatus))
    }
    catch(err) {
        res.status(400).send(JSON.stringify({verifyTag: err.message}))
    }
})```
naive vector
#
        floor = json["realEstate"]["properties"][0]["floor"]
        floor.get("value","Not listed")
#
  File "test.py", line 20, in propertyparser
    floor.get("value", "Not listed")
AttributeError: 'NoneType' object has no attribute 'get'
buoyant kestrel
#

Floor isn't there in that case then

#

Hmm

naive vector
#

But it is there just with null:

buoyant kestrel
ionic saffron
#

damn this man has a good organised pc

#

no i have like 7 different folders for python alone

#

its horrible

#

i have like Pyhon, _python, python2

#

fml

#

hahahaha

#

xd

vernal snow
worthy shore
#

same

#

but my code is a mess

#

xp

buoyant kestrel
ionic saffron
#

here is my current code im working on

#

xd

buoyant kestrel
#

Jesus

#

That's actually amazing

ionic saffron
#

ahahahahah, i need to clean it up before i start college

#

its so bad

buoyant kestrel
#

You risk bumping up against a weird Windows issue when paths are too long

ionic saffron
#

yeah ive seen that one on my internship

#

i indeed need to be carefull for that

worthy shore
#

i do the same thing and then organize afterwards

#

it's so wierd xp

buoyant kestrel
#

I do the same thing, then never do the other

ionic saffron
#

just this

#

i make new folders and think ill organize it later

#

and i never do it

worthy shore
#

i do eventually get to organizing afterward

#

but that takes me days to get to

buoyant kestrel
#

I relate to that on more levels than I want to admit

worthy shore
#

because procrastinate brain

ionic saffron
#

i did organize my onedrive when i originally started using it

#

but now its just a mess

worthy shore
#

now say that but even slower

#

xp

#

i'm thinking of making a python file that starts writing into another python file with the same code and then running that, all under a while true loop

naive vector
#
"floor":null,
worthy shore
#

obviously this will be on a virtual machine

worthy shore
#

ye exactly

ionic saffron
#

i made one that made infinte sql tables on accident

worthy shore
#

this is probably a way a virus spread's itself in your pc so you can't delete it easily

#

except its not under a while true

#

._.

#

oh well

#

to my linux machine!!

ionic saffron
#

hahah

#

good lucking trying to crash it

worthy shore
#

wish me luck! xp

#

virtual machines be like:
"My protection starts when your stupidity begins! now bow to me."

ionic saffron
#

maybe add a quit button

#

can be usefull

naive vector
#
        floor = json["realEstate"]["properties"][0]["floor"]
        if floor != None:
            floor.get("value")
        else
            floor = "not assigned"
ionic saffron
#

boston tea party 2.0

naive vector
worthy shore
#

can you use f strings in files?

ionic saffron
#

when making files?

worthy shore
#
file_number = 0
#example
while True:
    with open(f"Voldemort{file_number}.py", "w") as f:
ionic saffron
#

hahaha nice name choice

worthy shore
#

👍

naive vector
worthy shore
#

i just realized i made a mistake

#

this was how i went about my idea ```python
import os

filenumber = 0
while True:
with open(f"thisfile{filenumber}.py", "w") as f:
f.write(#this current file's code)
os.startfile(#the file from open)
filenumber += 1

#

i'd have to end up writing this infinitely

#

what should i do now?? =w=

ionic saffron
#

you can just copy the orginal file

#

and paste it

worthy shore
#

i'd have to do that to infinity

ionic saffron
#

yes jsut in a while

#

and in the same while you can open the file

#

and run it again

#

so its like a snwoball effexct

naive vector
#

How would I iterate over these photos to get the url's into list ??

velvet shale
#

ill ss the code

main valley
#

change your file paths

#

/ instead of \

#

lmk how that goes

velvet shale
#

different erro

#

error

#

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1164: error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims() <= 2 in function 'cv::matchTemplate'

main valley
#

looks like the data needs to be typecast somehow before going into cv.imread

#

maybe the API provides some sort of option for that

velvet shale
#

yeah

#

idk tho

#

ill send the tutorial im following if that makes anything easier?

main valley
#

so

#

try this

#

instead of cv.IMREAD_UNCHANGED

#

do cv.IMREAD_COLOR or cv.IMREAD_ANYCOLOR

#

in your cv.imread function call

#

I peep the valorant bot btw

#

I fw it heavily

velvet shale
#

aha

#

the entire goal is to make some form of either aimbot/aim assist

#

just cos im lazy

#

lmfao

main valley
#

lmao

#

that's awesome tbh

velvet shale
#

yeah

#

ive got a basic understanding of what i need to do to achieve it

main valley
#

keep me in the loop maybe we can coauthor, although i'm a mac user and don't play much valorant XD

velvet shale
#

just no clue at all on how to execute it

main valley
#

more of a splitgate / smite guy myself XD

#

did refactor a little AHK aimbot a while back

velvet shale
#

feel bad for splitgate devs

main valley
#

just basic color/image detection

velvet shale
#

game died not evne a month into release

velvet shale
main valley
#

lol boot it up every now and then

#

it's still fun

velvet shale
#

yeah

main valley
#

just not like a "i'm dedicated to this" kind of game

velvet shale
#

yeah i get wym

main valley
#

valorant has literally sucked up my whole friend group

velvet shale
#

haha

#

not surprised

#

its very good imo

main valley
#

it's like FPS chess

velvet shale
#

haha

#

ffs

#

getting another erorr

#

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1164: error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims() <= 2 in function 'cv::matchTemplate'

main valley
#

same one huh

velvet shale
#

got something to do with line 8

#

result = cv.matchTemplate(game_img, sova_img, cv.TM_CCOEFF_NORMED)

main valley
#

ahah

#

it looks like matchTemplate might require grayscale

#

have no idea why that's the case though

#

convert them to IMREAD_GRAYSCALE

#

seems counterintuitive

velvet shale
#

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'

#

fml

vernal snow
#

I hate these open cv assertion errors

velvet shale
#

yeah

vernal snow
#

it's just useless as fuck

velvet shale
#

opencv?

vernal snow
#

the assertion errors, yeah

#

open cv is alright

velvet shale
#

fair enough lmao

main valley
#

lol they don't describe anything

velvet shale
#

like reading ancient scriptures

#

</.> =?.w

main valley
#

lol

#

hieroglyphs

velvet shale
#

haha

main valley
#

hm can you verify that the images are actually being read in

velvet shale
#

how would you propose id do that

#

sorry if im making stupid mistakes its draining me tryna figure this out]

#

been at it for ages

main valley
#

should be cv.imshow("Image Name", image_variable)

velvet shale
#

same error

main valley
#

comment out that line

#

the error line

velvet shale
#

wiat wat

#

im confused

main valley
#

just trying to determine whether the image is read and displays as grayscale properly

#

so the error line is useless

#

once that's determined then we can move down and try to debug matchTemplate more

#

brb

velvet shale
#

ima try figure this out tomorrow

main valley
#

lol

velvet shale
#

too late for programming

#

and i cba

main valley
#

fair

velvet shale
#

ill figure it out tomorrow

covert fiber
#

we can't talk here mate 😔 @undone vessel

#

oh

#

i can't talk in general

#

what

#

why

#

yeah i am stupid

#

i don't have vc perms

#

yes

#

it's pretty nice sounding man

#

alright man i can't talk here

#

sorry :(

#

i'll hop off

calm bay
calm bay
primal bison
#

@trim pelican why are u being so strict

#

famous

#

@trim pelican May I DM you.

#

To ask you some

#

I will feel embarresed talking in live coding

#

THEN WHY U IN PYTHON

#

SERVER

#

anyone in the vc know tinker?

ionic saffron
#

tkinter?

primal bison
#

ye

#

ok its gonna sound really really super dupa amazing pro program so ill pay $50 for a working roblox alt generator made in tkinter

#

@wise garden

#

yall ignoring me now?

primal bison
#

@wise garden sounds like a yt

#

what if i dont want to

#

who gonna stop me

#

16

#

wys

#

What Ya Saying Jit

trim pelican
trim pelican
primal bison
#

But my brain is being filled w random ah words w wat ever yall saying

primal bison
trim pelican
#

what word was complicated to you?

primal bison
#

all of it

trim pelican
#

0_0

#

it was just english

#

so i am guessing you are not a strong user of english

ionic saffron
#

nah we were speaking french

trim pelican
#

where are you from mau?

primal bison
#

UK

#

but im polish

trim pelican
#

BRUH

#

BRUH

#

BRUH

#

you are in UK and you cannot understand what we are saying?

#

🤔

ionic saffron
#

to be fair

trim pelican
ionic saffron
#

some of the words were complicated

trim pelican
#

FML

ionic saffron
#

if you dont know much about programming

trim pelican
ionic saffron
#

yes

trim pelican
#

yeah ofcourse you need some knowledge about programming language terms

ionic saffron
#

man prob still struggling with parent object

primal bison
#

how do u print using python

ionic saffron
#

print("text")

trim pelican
primal bison
#

thats batch

#

not pytho

#

python

ionic saffron
#

thats also python

primal bison
#

ho well

#

oh

#

idk

#

python

#

im just learning

trim pelican
#

my brain right now :

trim pelican
#

😂

ionic saffron
#

are you by any chance from eastern europe

#

@trim pelican

trim pelican
ionic saffron
#

oh

#

nvm

primal bison
#

``

class BaronsBot(discord.Bot):
def init(self):
self.version = "1.0.0"

    dotenv.load_dotenv()

    super().__init__(
        debug_guilds=json.loads(os.getenv("DEBUG_GUILDS")),
        intents=discord.Intents.all(),
    )

``

#

@wise garden add that to the top

#

 async def on_guild_join(self, guild: discord.Guild) -> None:
        print(f"> Joined a new guild [{guild.name} - {guild.id}] as "
              f"{self.user.name}#{self.user.discriminator} with UID of {self.user.id}!")

trim pelican
#

😶

primal bison
trim pelican
#

awesome, perfect way to get ignored

primal bison
#

LOL

primal bison
#

@wise garden

    async def on_interaction(self, interaction: discord.Interaction) -> None:
        if not interaction.user.bot:
            await self.process_application_commands(interaction)

add that to the bottom

trim pelican
primal bison
#

he just ignoring me

#

smh

hexed sentinel
#

Anyone knows how to excute complex math in python ?

#

I am trying to make smth but can't find the thing I am looking for on youtube

trim pelican
hexed sentinel
#

I tried but failed

trim pelican
#

ok, have fun, bye

#

😂

hexed sentinel
ionic saffron
#

no just maths

ionic saffron
#

smth like that

hexed sentinel
#

Man

#

I am going to work a lot more on this that thought

#

:(

worthy shore
#

what about the math module?

#

i hate ppl like that

ionic saffron
#

super how is the copying python file going

worthy shore
#

i ended up giving up on it

#

because i couldn't find a way to open files in linux

#

bc APPARENTLY

#

os.startfile() ONLY WORKS IN WINDOWS!

hexed sentinel
#

Guys can I run a command in a loop that gives an output everytime and collect the output in to a list ?

worthy shore
#

anyone else just so oversecure about your personal files that you make a folder lock within python and make a completely separated password manager that is literally some text that was encrypted twice so people will think it's encrypted but it's your actual password and if they try to break into your stuff you make a program as a failsafe in case someone gets the password wrong trying to break in?

#

no?

#

okay i guess

#

oh did i mention that the screen flips too?

pallid anchor
#

how can i gain permission to speak

ivory marten
#

hello @lost apex

lost apex
wintry stream
#
import pygame, sys
from pygame.locals import *

pygame.init()

win = pygame.display.set_mode((800, 600))
pygame.diplsay.set_caption("Just A Test")

def gameDraw():
  win.fill((255, 255, 255))

def gameloop():
  clock = pygame.time.Clock()
  while True:
    clock.tick(60)
    for event in pygame.event.get():
      if event.type == QUIT:
        pygame.quit()
        sys.exit()

gameloop()
#

yo guys

outer loom
#

hmm

worthy shore
#

i don't have a mic

#

no amount of voice verification can get me outta that one =w=

#

i understood none of those words

#

yes i do not have that

#

i mean there are help rooms you can use

#

glad i could help. you too! ^w^

buoyant kestrel
#

!resources @echo aurora

timid fjordBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

honest pasture
#

>Not to interrupt
>Literally goes into life story

calm bay
proper cobalt
#

brb standup

glass forum
gray oracle
#

Hi

calm bay
#
@compiler c_include "SDL/SDL2.h"
#

#pragma

buoyant kestrel
#

_xXxCompiler6969xXx_

glass forum
#

_xXxCompiler6969HDLPxXx_

acoustic scarab
#

Hi guys

#

anyone know to change my code to app in vs code?

hasty barn
south walrus
#

anyone wanna code something with me in vs code live share

opaque wing
#

yea

delicate socket
#

Hi

ivory marten
#

hello @@hollow mantle

#

yes but idon't have a mic

#

what are you working on

#

waht

#

what

leaden comet
#

hi

#

I'm muted

primal bison
#

@gritty tulip do i know you ?

gritty tulip
#

I don't think so, why?

worthy shore
#

hello

calm bay
#

@atomic phoenix

carmine current
undone vessel
#

xaxb = [
    [  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0'],
    [  '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',  '8',  '9',  'a',  'b',  'c',  'd',  'e',  'f', '10'],
    [  '0',  '2',  '4',  '6',  '8',  'a',  'c',  'e', '10', '12', '14', '16', '18', '1a', '1c', '1e', '20'],
    [  '0',  '3',  '6',  '9',  'c',  'f', '12', '15', '18', '1b', '1e', '21', '24', '27', '2a', '2d', '30'],
    [  '0',  '4',  '8',  'c', '10', '14', '18', '1c', '20', '24', '28', '2c', '30', '34', '38', '3c', '40'],
    [  '0',  '5',  'a',  'f', '14', '19', '1e', '23', '28', '2d', '32', '37', '3c', '41', '46', '4b', '50'],
    [  '0',  '6',  'c', '12', '18', '1e', '24', '2a', '30', '36', '3c', '42', '48', '4e', '54', '5a', '60'],
    [  '0',  '7',  'e', '15', '1c', '23', '2a', '31', '38', '3f', '46', '4d', '54', '5b', '62', '69', '70'],
    [  '0',  '8', '10', '18', '20', '28', '30', '38', '40', '48', '50', '58', '60', '68', '70', '78', '80'],
    [  '0',  '9', '12', '1b', '24', '2d', '36', '3f', '48', '51', '5a', '63', '6c', '75', '7e', '87', '90'],
    [  '0',  'a', '14', '1e', '28', '32', '3c', '46', '50', '5a', '64', '6e', '78', '82', '8c', '96', 'a0'],
    [  '0',  'b', '16', '21', '2c', '37', '42', '4d', '58', '63', '6e', '79', '84', '8f', '9a', 'a5', 'b0'],
    [  '0',  'c', '18', '24', '30', '3c', '48', '54', '60', '6c', '78', '84', '90', '9c', 'a8', 'b4', 'c0'],
    [  '0',  'd', '1a', '27', '34', '41', '4e', '5b', '68', '75', '82', '8f', '9c', 'a9', 'b6', 'c3', 'd0'],
    [  '0',  'e', '1c', '2a', '38', '46', '54', '62', '70', '7e', '8c', '9a', 'a8', 'b6', 'c4', 'd2', 'e0'],
    [  '0',  'f', '1e', '2d', '3c', '4b', '5a', '69', '78', '87', '96', 'a5', 'b4', 'c3', 'd2', 'e1', 'f0'],
    [  '0', '10', '20', '30', '40', '50', '60', '70', '80', '90', 'a0', 'b0', 'c0', 'd0', 'e0', 'f0', '100']]

#

multiplication table lol

remote stream
#

s

#
df[['date','time','off1','off2']] =                      
np.where(df['timestamp'].str.contains(pat="patternmatch",regex=True), \
df['timestamp'].str.split(pat='\s', n=-1, expand=True), \
'NaN')
#

ValueError: operands could not be broadcast together with shapes (XXXX,) (XXXX,4) ()

#
col
15/0/2022 22:7:9 6 360

wrong

col1          col2       col3     col4
15/0/2022     22:7:9      6        360
#

2022-01-15 22:07:09

#

ASLKdalADLANSD

#

NaT

leaden comet
#

the stream isn't working

carmine current
#

there is no stream, try pressing ctrl + r sometimes discord is stuck

leaden comet
#

ah ok thank you

carmine current
#
col                       | col2
"15/0/2022 22:7:9 6 360"  | 5
"asdsaasddsadas asd    "  | 12
#
col1         | col2       | col3    | col4
15/0/2022    | 22:7:9     | 6       | 360
NaN          | NaN        | NaN     | NaN
undone vessel
#
def strStripAccents(s):
    d = {
        'À':'A', 'Á':'A', 'Â':'A', 'Ã':'A', 'Ä':'A', 'à':'a', 'á':'a', 'â':'a', 'ã':'a', 'ä':'a',
        'È':'E', 'É':'E', 'Ê':'E', 'Ë':'E', 'è':'e', 'é':'e', 'ê':'e', 'ë':'e',
        'Í':'I', 'Ì':'I', 'Î':'I', 'Ï':'I', 'í':'i', 'ì':'i', 'î':'i', 'ï':'i',
        'Ò':'O', 'Ó':'O', 'Ô':'O', 'Õ':'O', 'Ö':'O', 'ò':'o', 'ó':'o', 'ô':'o', 'õ':'o', 'ö':'o',
        'Ù':'U', 'Ú':'U', 'Û':'U', 'Ü':'U', 'ù':'u', 'ú':'u', 'û':'u', 'ü':'u',
        'Ñ':'N', 'ñ':'n', 'Ç':'C', 'ç':'c'}

    ss = [d[c] if c in d else c for c in s]
    ss = ''.join(ss)
    return ss
#

more useful fct I build

remote stream
#
tst_df = df['timestamp'].str.contains(pat="patternmatch", regex=True)
pd.Series(tst_df).where(lambda x: x==False).dropna()
snow crest
#

df = df[df['timestamp'].notna()] or df[df['column name'].isna()]

#

instead of notna() use the regex to select only those rows in df,

#

pd.concat(df1,df2)

remote stream
#
df[['day','month','year']] = df['date'].str.split(pat='/', n=-1, expand=True)
df[['hour','minute','second']] = df['date'].str.split(pat=':', n=-1, expand=True)
df['month'] = df['month'].astype(int) + 1
df['timestamp'] = pd.to_datetime(df[['day','month','year','hour','minute','second']])
carmine current
undone vessel
#

and dont forget to implement NTP sync for you server 😛

remote stream
#

pd.to_datetime()

carmine current
snow crest
#

Nice session, have to go now see you guys 🙂

remote stream
remote stream
#
class Person:
  def __init__(self, name, age):
    self.name = name
    self.age = age

p1 = Person("John", 36)

print(p1.name)
print(p1.age)

^^ why pass name twice when doing self.name = name?

#
p1 = Person("36", "John")
carmine current
#

!e ```py
class Person:
def init(self, name, age):
self.name = name
self.age = age

p1 = Person("John", 36)

print("name:", p1.name)
print("age:", p1.age)
p2 = Person(36, "name")
print("name:", p2.name)
print("age:", p2.age)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | name: John
002 | age: 36
003 | name: 36
004 | age: name
carmine current
#

!e ```py
class Person:
def init(self, *, name, age):
self.name = name
self.age = age

p1 = Person(age=36, name="John")
print(p1.age)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

36
carmine current
#

!e ```py
class Person:
def init(self, name="", age=0):
self.name = name
self.age = age

p1 = Person(age=36, name="John")
print(p1.age)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

36
carmine current
#

!e ```py
class Person:
def init(self, name, age):
self.name = name
self.age = age

p1 = Person(age=36, name="John")
print(p1.age)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

36
remote stream
#
%macro something(age=,name=);
..something else...
%mend;
%something(age = 36, name = "John");
carmine current
#

!e ```py
class Person:
def init(self, name, age):
self.name = name
self.age = age
print(self)

def printme(self):
print(self)

p1 = Person(age=36, name="John")
print("\n init done\n")
p1.printme()

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <__main__.Person object at 0x7f5f5ca3f7d0>
002 | 
003 |  init done
004 | 
005 | <__main__.Person object at 0x7f5f5ca3f7d0>
carmine current
#

!e ```py
class Empty:
pass

print(Empty)
print(Empty())

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <class '__main__.Empty'>
002 | <__main__.Empty object at 0x7fbff310f1d0>
carmine current
#

!e ```py
from datetime import datetime

print(datetime)
dt = datetime.now()
print(dt)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | <class 'datetime.datetime'>
002 | 2022-08-05 23:13:11.455328
carmine current
#
class Db2:
   def __init__(self, username, password):
    self.username = username
    self.password = password

  def connect(self):
    return do_db2_connectio(self.username, self.password)

class PostgreSQL:
   def __init__(self, username, password):
    self.username = username
    self.password = password

  def connect(self):
    return do_postgres_connectio(self.username, self.password)

class DbConnection:
  def __init__(self, username, password, dbtype="db2"):
    if dbtype == "db2":
      self.conn = Db2(username, password)
    elif dbtype == "postgres":
      self.conn = PostgreSQL(username, password)

  def connect(self):
    return self.conn.connect()

con = DbConnection("a", "b", dbtype="postgres")
con.connect()
#

!resources

timid fjordBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

pale crag
#

@solid storm can i add you as a friend on discord if i ever need Python help? 😅 I am a big newbie

solid storm
#

Sure

carmine current
#

!e ```py
import math

class Point:
def init(self, x, y):
self.x = x
self.y = y

def distance_to(self, other):
return math.sqrt((self.x - other.x)**2 + (self.y - other.y)**2)

class Rect:
def init(self, x, y, width):
self.x = x
self.y = y
self.width = width

def distance_to(self, other):
return math.sqrt((self.x - other.x)**2 + (self.y - other.y)**2)

p = Point(1, 3)
r = Rect(4, 5, 2)
dist = r.distance_to(p)
print(dist)

timid fjordBOT
#

@carmine current :white_check_mark: Your 3.11 eval job has completed with return code 0.

3.605551275463989
remote stream
#

Very good help from @carmine current and @solid storm

carmine current
#

but the Rect still stored the width for other operations for which you might need it

#

theres also a concept with Classes that makes this way less verbose and means that you dont duplicate code

#

(inheritance)

remote stream
#

@carmine current what is the meaning of self.x - other.x ? I'm confused how it's used twice

carmine current
#

self.x: the current objects x
other.x: the x oft the OTHER one we are calculating the distance to

remote stream
#

@carmine current meaning how x is used twice with both self and other

carmine current
#

self.x means "x of self" and other.x means "x of other"

#

so we subtract the own x from the others x

pale crag
#

Yall have a good rest of your day! gotta go

shut spindle
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

shut spindle
#

!e <a="hello \r world">

timid fjordBOT
#

@shut spindle :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     <a="hello \r world">
003 |     ^
004 | SyntaxError: invalid syntax
lyric mountain
#

@calm bayhello

#

so what are you doing

#

@calm bay

#

is it fast

#

your programming language

#

looks complicated lol

#

i mean as a c# dev everything looks complicated

#

@true forum hey

#

how are you doing

#

!e

timid fjordBOT
#
Missing required argument

code

lyric mountain
#

!eval 3.10 print("hello world")

timid fjordBOT
#

@lyric mountain :white_check_mark: Your 3.10 eval job has completed with return code 0.

hello world
calm bay
small tree
#

!eval print("Hello World")

timid fjordBOT
#

@small tree :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello World
plush flume
#

hey i just wanted to known if we can print nested list in reverse also including list in list in reverse

ivory brook
#

!eval print("hehe")

timid fjordBOT
#

@ivory brook :white_check_mark: Your 3.11 eval job has completed with return code 0.

hehe
primal bison
#

!eval print('hi')

timid fjordBOT
#

@primal bison :white_check_mark: Your 3.10 eval job has completed with return code 0.

hi
turbid mango
#

!eva name = input("Wat si your name")

#

yes

hoary sluice
#

!eval name = input("Wat si your name")

timid fjordBOT
#

@hoary sluice :x: Your 3.10 eval job has completed with return code 1.

001 | Wat si your nameTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
woven slate
#

!eval print('hi')

ancient crane
#

.

fresh sail
rain jay
#

!eval import(os).system('ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'os' is not defined
rain jay
#

!eval import('os').system('ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     import('os').system('ls')
003 |           ^
004 | SyntaxError: invalid syntax
rain jay
#

!eval import(os).system('ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'os' is not defined
rain jay
#

!eval "\ import"(os).system('ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | <string>:1: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
002 | Traceback (most recent call last):
003 |   File "<string>", line 1, in <module>
004 | NameError: name 'os' is not defined
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     \__ import__(os).system('ls')
003 |      ^
004 | SyntaxError: unexpected character after line continuation character
rain jay
#

!eval print('hello')

timid fjordBOT
#

@rain jay :white_check_mark: Your 3.10 eval job has completed with return code 0.

hello
rain jay
#

!eval import

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     import
003 |           ^
004 | SyntaxError: invalid syntax
rain jay
#

!eval import subprocess

timid fjordBOT
#

@rain jay :warning: Your 3.11 eval job has completed with return code 0.

[No output]
rain jay
#

!eval import subprocess

timid fjordBOT
#

@rain jay :warning: Your 3.11 eval job has completed with return code 0.

[No output]
rain jay
#

!eval import subprocess
subprocess.run('ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'ls'
rain jay
#

!eval import subprocess
subprocess.run('bash ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'bash ls'
rain jay
#

!eval import subprocess
subprocess.run('bash')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'bash'
rain jay
#

!eval import subprocess
subprocess.run('cmd /c ')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'cmd /c '
rain jay
#

!eval import subprocess
subprocess.run('/usr/bin/env/bash')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/env/bash'
rain jay
#

!eval import subprocess
subprocess.run('!eval import subprocess
subprocess.run('bash -c ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     subprocess.run('!eval import subprocess
003 |                    ^
004 | SyntaxError: unterminated string literal (detected at line 2)
rain jay
#

!eval import subprocess
subprocess.run('bash -c ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'bash -c ls'
rain jay
#

!eval import subprocess
subprocess.run('zsh -c ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'zsh -c ls'
rain jay
#

!eval import subprocess
subprocess.run('fish -c ls')

timid fjordBOT
#

@rain jay :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/usr/local/lib/python3.11/subprocess.py", line 546, in run
004 |     with Popen(*popenargs, **kwargs) as process:
005 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
006 |   File "/usr/local/lib/python3.11/subprocess.py", line 1022, in __init__
007 |     self._execute_child(args, executable, preexec_fn, close_fds,
008 |   File "/usr/local/lib/python3.11/subprocess.py", line 1899, in _execute_child
009 |     raise child_exception_type(errno_num, err_msg, err_filename)
010 | FileNotFoundError: [Errno 2] No such file or directory: 'fish -c ls'
#

@rain jay :warning: Your 3.11 eval job has completed with return code 0.

[No output]
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['requirements', 'config']
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['requirements', 'config']
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['requirements', 'config']
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['snekbox.cfg', 'gunicorn.conf.py', '__pycache__']
rain jay
#

!eval import os
os.chdir('..')
print(os.listdir())

timid fjordBOT
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['usr', 'snekbox', 'lib64', 'lib', 'etc']
rain jay
#

!eval import os
os.chdir('requirements')
print(os.listdir())

timid fjordBOT
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

['pip-tools.pip', 'coverage.pip', 'coveralls.in', 'pip-tools.in', 'coverage.in', 'lint.in', 'coveralls.pip', 'lint.pip', 'requirements.pip']
limpid echo
#

Hello, python newbie here!
Currently learning python via projects -based coding. Anyone able to join me for screen share for guidance purpose?

limpid echo
#

!eval import os
os.getenv('..')
print(os.listdir())

timid fjordBOT
#

@limpid echo :white_check_mark: Your 3.10 eval job has completed with return code 0.

['requirements', 'config', 'user_base']
acoustic adder
rose flint
#

hi

modest forge
#

what does return fuction does?

limpid echo
# acoustic adder thats awesome! whats the project that your working on?

This is what i have created so far and it works fine apart from few improvement needed.

working_directory = os.getcwd()

# Parse command line arguments
parser = argparse.ArgumentParser(description='Execute terrascan scan on specific project. \nFormat: python3 runterrascantf.py <environment> <folder/project>;')
parser.add_argument('environment_name', type=str) 
parser.add_argument('folder_and_project', type=str) 
args = parser.parse_args()

# Grab environment, folder, and project names
environment_name = args.environment_name
folder_and_project = args.folder_and_project

# Construct path to project
project_directory = f"{working_directory}/environments/{environment_name}/{folder_and_project}"

try:
    print("STARTING DIRECTORY")
    print(working_directory)
    print("MOVING INTO PROJECT DIRECTORY")
    os.chdir(project_directory)
    print(project_directory)
    shell_command = subprocess.run(["", "plan", "apply"], stderr=subprocess.PIPE, text=True)
    print(shell_command.stderr)
except FileNotFoundError:
    print("Project cannot be found. Check your environment, folder, and project names, and try again.")```
#

I wanted to make it a bit more mature looking code by adding some condition/verification checks for example having functions, if/else but quiet sure how do to that . Can you help?

turbid stream
#

!eval
print("Hello World")

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello World
turbid stream
#

!e
print("test")

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

test
turbid stream
#

!eval

x = 50
y = 50
print(x + y)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

100
dense fulcrum
turbid stream
#

!eval

list = [5, 10, 15, 20]

addition = list[0] + list[3]
print(addition)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

25
turbid stream
#

!eval

list = [5, 10, 15, 20]
store = 0

for i in range(len(list)):
store = store + list[i]

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     store = store + list[i]
003 |     ^
004 | IndentationError: expected an indented block after 'for' statement on line 4
turbid stream
#

!eval

list = [5, 10, 15, 20]
store = 0

for i in range(len(list)):
store = store + list[i]
print(store)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

50
turbid stream
#

!eval
import time

print(“Test1”)
time.sleep(5)
print(“Test2.”)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(“Test1”)
003 |           ^
004 | SyntaxError: invalid character '“' (U+201C)
turbid stream
#

!eval
import time

print("Test1.”)
time.sleep(5)
print(“Test2.”)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print("Test1.”)
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 3)
turbid stream
#

!eval
import time

print(“Test1”)
time.sleep(5)
print(“Test2.”)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(“Test1”)
003 |           ^
004 | SyntaxError: invalid character '“' (U+201C)
turbid stream
#

print(“test”)

#

!eval print(“test”)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(“test”)
003 |           ^
004 | SyntaxError: invalid character '“' (U+201C)
turbid stream
#

mobile smh

#

!eval
import time

print(”Test1“)
time.sleep(5)
print(”Test2.“)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(”Test1“)
003 |           ^
004 | SyntaxError: invalid character '”' (U+201D)
turbid stream
#

!eval

print(5)
time.sleep(5)
print(10)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 | 5
002 | Traceback (most recent call last):
003 |   File "<string>", line 2, in <module>
004 | NameError: name 'time' is not defined
turbid stream
#

!eval
import time
print(5)
time.sleep(5)
print(10)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 5
002 | 10
turbid stream
#

!eval
import time
print(5)
time.sleep(30)
print(10)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job timed out or ran out of memory.

5
turbid stream
#

Good.

#

!eval print(“ok”)

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(“ok”)
003 |           ^
004 | SyntaxError: invalid character '“' (U+201C)
turbid stream
#

!eval print(0)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

0
turbid stream
#

!eval

byte_list = [10100101, 10100101, 10100101]

count = 24 / 8
print(count)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

3.0
dense fulcrum
turbid stream
#

This discord is an amazing tool if you ever have any questions or errors within your code.

dense fulcrum
turbid stream
#

!eval print(10)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

10
gusty spire
#

!eval
import secrets
print(secrets.token_hex(16))

timid fjordBOT
#

@gusty spire :white_check_mark: Your 3.11 eval job has completed with return code 0.

2da94c11e4f316574885a2a845c9a2dc
timid fjordBOT
#
Missing required argument

code

#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

midnight escarp
#

!eval print('hello world')

timid fjordBOT
#

@midnight escarp :white_check_mark: Your 3.10 eval job has completed with return code 0.

hello world
void torrent
#

!eval
a=0
while True:
a=+1
print(a)

timid fjordBOT
#

@void torrent :warning: Your 3.10 eval job timed out or ran out of memory.

[No output]
void torrent
#

!eval a=0
while True:
a=+1
print(a)

timid fjordBOT
#

@void torrent :x: Your 3.10 eval job has completed with return code 143 (SIGTERM).

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

void torrent
#

!eval
a=butterfly
while True"
print("Hemlock loves {a}")

timid fjordBOT
#

@void torrent :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     while True"
003 |               ^
004 | SyntaxError: unterminated string literal (detected at line 2)
void torrent
#

!eval
a=butterfly
while True:
print("Hemlock loves {a}")

timid fjordBOT
#

@void torrent :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'butterfly' is not defined
void torrent
#

!eval
a='butterfly'
while True:
print("Hemlock loves {a}")

timid fjordBOT
#

@void torrent :x: Your 3.11 eval job has completed with return code 143 (SIGTERM).

001 | Hemlock loves {a}
002 | Hemlock loves {a}
003 | Hemlock loves {a}
004 | Hemlock loves {a}
005 | Hemlock loves {a}
006 | Hemlock loves {a}
007 | Hemlock loves {a}
008 | Hemlock loves {a}
009 | Hemlock loves {a}
010 | Hemlock loves {a}
011 | Hemlock loves {a}
... (truncated - too many lines)

Full output: too long to upload

void torrent
#

!eval
a=butterfly
while True:
print("Hemlock loves",a)

timid fjordBOT
#

@void torrent :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'butterfly' is not defined
void torrent
#

!eval
a='butterfly'
while True:
print("Hemlock loves",a)

timid fjordBOT
#

@void torrent :x: Your 3.11 eval job has completed with return code 143 (SIGTERM).

001 | Hemlock loves butterfly
002 | Hemlock loves butterfly
003 | Hemlock loves butterfly
004 | Hemlock loves butterfly
005 | Hemlock loves butterfly
006 | Hemlock loves butterfly
007 | Hemlock loves butterfly
008 | Hemlock loves butterfly
009 | Hemlock loves butterfly
010 | Hemlock loves butterfly
011 | Hemlock loves butterfly
... (truncated - too many lines)

Full output: too long to upload

steel sail
limpid echo
#

still?

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello World
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     for i in range(True):
003 |                          ^
004 | IndentationError: expected an indented block after 'for' statement on line 1
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello World
002 | Hello World
003 | Hello World
004 | Hello World
005 | Hello World
006 | Hello World
007 | Hello World
008 | Hello World
009 | Hello World
010 | Hello World
011 | Hello World
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/valexutuda.txt?noredirect

buoyant kestrel
#

!kindling

timid fjordBOT
#

Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

buoyant kestrel
#

Feeling antsy

buoyant kestrel
#

God

#

Damn

#

It

calm bay
honest pasture
#
from string import ascii_lowercase
def f(s):
    set_s = set(s.lower())
    return all(c in set_s for c in alphabet)
#

!e
from string import alphabet
print(alphabet)

timid fjordBOT
#

@honest pasture :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ImportError: cannot import name 'alphabet' from 'string' (/usr/local/lib/python3.11/string.py)
buoyant kestrel
#

!e

import string
print(string.__dict__)
timid fjordBOT
#

@buoyant kestrel :white_check_mark: Your 3.11 eval job has completed with return code 0.

{'__name__': 'string', '__doc__': 'A collection of string constants.\n\nPublic module variables:\n\nwhitespace -- a string containing all ASCII whitespace\nascii_lowercase -- a string containing all ASCII lowercase letters\nascii_uppercase -- a string containing all ASCII uppercase letters\nascii_letters -- a string containing all ASCII letters\ndigits -- a string containing all ASCII decimal digits\nhexdigits -- a string containing all ASCII hexadecimal digits\noctdigits -- a string containing all ASCII octal digits\npunctuation -- a string containing all ASCII punctuation characters\nprintable -- a string containing all ASCII characters considered printable\n\n', '__package__': '', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f0146466f90>, '__spec__': ModuleSpec(name='string', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f0146466f90>, origin='/usr/local/lib/python3.11/string.py'), '__file__': '/usr/local/lib/python3.11/string.py', '__cac
... (truncated - too long)

Full output: https://paste.pythondiscord.com/obehavebok.txt?noredirect

buoyant kestrel
#
def is_pangram(s):
    all_chars = set([let for let in s.lower() if let.isalpha()])
    
    return len(all_chars) == 26
patent jungle
gusty spire
#

It's fantastic

limpid coral
#
def duplicate_encode(word):
    out = ""
    for letter in word.lower():
        out += "(" if word.count(letter) > 1 else ")"
    return out

print(duplicate_encode("Success"))
#

essentially the same

gusty spire
#

mindblowing this lambda function

primal bison
#

What Year Is It?

warped bobcat
timid fjordBOT
#

@warped bobcat :white_check_mark: Your 3.11 eval job has completed with return code 0.

2022
keen dirge
#

hey im learning python

#

I havent done it in about 2 years so im back

#

and since im back i joined this sever for help if i need any

#

ima get coding on repl.it and codecademey

primal bison
#

!resources obligatory

timid fjordBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

brisk atlas
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

turbid stream
#

!e

total = 5

while True:

timid fjordBOT
#

@turbid stream :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     while True:
003 |                ^
004 | IndentationError: expected an indented block after 'while' statement on line 3
turbid stream
#

!e

total = 5, 5

print(total)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

(5, 5)
turbid stream
#

!e

x, y = 5,5

print(x + y)

timid fjordBOT
#

@turbid stream :white_check_mark: Your 3.11 eval job has completed with return code 0.

10
primal bison
#

What does True and false mean in code

rain jay
#

!e
MyVariable = True
#this is a boolean variable
if MyVariable:
print("MyVariable is True")
else:
print("MyVariable is False")

timid fjordBOT
#

@rain jay :white_check_mark: Your 3.11 eval job has completed with return code 0.

MyVariable is True
rain jay
primal bison
#

Hmm

#

Thanks for ur help anyway i dont know if i fully get what u saod

#

So itd like if 1+1 is 2 then be true

austere osprey
#

I am new here

#

i joined this server as i am learning api development with fastapi ,pydantic and sqlalchemy but i don't know the path and have no experience in developing apis so can anyone help?.PLZ

manic wharf
primal bison
#

Oh ty

manic wharf
#

1 + 1 == 2 would return True

primal bison
#

Duck man

#

Oh

manic wharf
#

1 + 1 != 2 would return False

primal bison
#

Ohh

#

So when would you place it

#

Can you make something true

manic wharf
#

like give an example of what you mean

primal bison
#

Your subjective truth being true to the computer

#

So can i write 1+1=3 make that Trur

manic wharf
#

no

primal bison
#

Ohh

#

Ok

#

Thanks

#

!e True If 1+1=2

manic wharf
primal bison
#

Im still learnibg

#

Whatd =s

manic wharf
#

I just mean 2 of the equal signs

primal bison
#

Oh like equals

#

Im confused

manic wharf
#

like

primal bison
#

Coding rlly be confusing me

manic wharf
#

you don't do
1 + 1 = 2

#

you do

#

1 + 1 == 2

primal bison
#

Why

#

So two ewual signs ok

manic wharf
#

because only 1 = means variable assignment

primal bison
#

Ohhh right

manic wharf
#

so you can do
x = 5

primal bison
#

Riggt

#

U right

#

Thanks duck dude

manic wharf
#

np

#

so about the true and false thing

primal bison
#

Mhm

#

I think im gettingnit

#

I wanna make the only calculator u will ever need

manic wharf
#

comparisons (==, !=, >, >=, <, and <=) will result in a boolean variable

#

True or False

manic wharf
#

depending on if the said statement is true

primal bison
#

Oh ok

#

Thanks

manic wharf
#

np

primal bison
#

Wait

manic wharf
#

yea

primal bison
#

How hard is it making a calculator

#

It looks easy

manic wharf
#

if you're just doing it on the console, then it's not hard

primal bison
#

And i dont know how to make a gui

#

Should i use a 3rd party app for that

#

Like that anvil thingy app

manic wharf
#

If you want to make a gui... that's going to be quite a bit harder

primal bison
#

Unless i use a 3rd party app

manic wharf
#

I'm not the person to ask for that, but the only thing I know of is pygame

primal bison
#

Right

#

Oh

#

Thanks

#

Im not just tryna use console

#

Tryna actually make stuff

manic wharf
primal bison
#

Huh

manic wharf
#

pygame is a library

#

primarily used for making games with python, but it's the only thing that I know of at this current point for guis

#

It would def be able to make the calculator you want

#

but it may be a bit hard

#

Since you're newer to programming, I'd recommend you start at first with making the calculator on the console first

#

@primal bison

primal bison
#

Ok

#

Thanks

cinder thistle
#

what is a good place to learn intermediate python

rare wyvern
#

There are no sound in the current live

#

Now working

fresh sail
#
worn snow
#

is dis golang

#

@calm bay

calm bay
#

no it's not

#

it's my own language

fresh sail
#

The Ghost Festival, also known as the Zhongyuan Festival (traditional Chinese: 中元節; simplified Chinese: 中元节) in Taoism and Yulanpen Festival (traditional Chinese: 盂蘭盆節; simplified Chinese: 盂兰盆节; pinyin: Yúlánpénjié) in Buddhism, is a traditional Taoist and Buddhist festival held in certain East Asian countries. According to the Chinese calendar...

buoyant kestrel
#

Damn it

#

I want to be watching you guys but I have to tear down and move a standing desk to a different office

#

@calm bay What are you guys working on

calm bay
buoyant kestrel
#

Cool

#

So frustrating, I want to come watch

timid fjordBOT
#

src/chi2test.cpp lines 26 to 33

/*
 * =======================================================================
 *   WARNING    WARNING    WARNING    WARNING    WARNING    WARNING
 * =======================================================================
 *   Remember to put on SAFETY GOGGLES before looking at this file. You
 *   are most certainly not expected to read or understand any of it.
 * =======================================================================
 */```
honest pasture
buoyant kestrel
#

@calm bay

static hill
#

Monokai 🤮

buoyant kestrel
#

!stream 772803759189131275

timid fjordBOT
#

✅ @hasty cedar can now stream until <t:1660767448:f>.

static hill
#

Too brown for me

#

That's a nice theme

#

I use Community Material Theme Panelight High Contrast

buoyant kestrel
static hill
#

@calm bay how do you search like that

wary lance
#

Oh right. There was something I had to start VSCode with.

#

Copying code with syntax highlighting for a PowerPoint presentation.

carmine current
buoyant kestrel
wary lance
#

Had Kate always looked like that?

#

I remember seeing it being quite bare boned about... a decade ago.

buoyant kestrel
#

Possibly

vernal snow
#

wasting my time on this debate, I need to get developing

calm bay
#
POINTER = 0
ARRAY = 1
FUNC = 2
INT = 3

T_PTR = (POINTER, None)
T_INT = (INT, None)
T_ARR = lambda x: (ARRAY, x)
T_FUNC = lambda types, ret: (FUNC, (types, ret))

def gen(name, types):
    # I really have no idea what to do here...
    pass

# We emulate a compound type as a "list" of types
#    - pointer to pointer to int is [T_PTR, T_PTR, T_INT]
#    - pointer to int is [T_PTR, T_INT]
#    - int is [T_INT]
#    - array of int is [T_ARR, T_INT]

print(gen("ptr_to_arr", [T_PTR, T_ARR(10), T_INT]))         # int (*ptr_to_arr)[10]
print(gen("func_ptr", [T_FUNC([T_INT, T_INT], T_INT)]))     # int (*func_ptr)(int, int)
print(gen("nested_arr", [T_ARR(20), T_ARR(10), T_INT]))     # int nested_arr[20][10]
jagged granite
#

NO

#

Why would you do that?

#

Does Kate even support LSPs?

#

Kate has autocomplete?
I'll be back

carmine current
buoyant kestrel
summer garden
#

hello!

#

i did a bit of python coding but i started today so what do yall think?

#

i am not that smart but as i said i just started

jagged granite
#

For whoever asked

#

OMG

#

Kate does have autocomplete

#

I never knew

#

But... I mean, if I wanted to use something worse than PyCharm, I'd just use VS Code

vernal snow
#

.xkcd 2347

#

is that not the command?

jagged granite
#

Lance?

#

.ping

vivid terraceBOT
#
:ping_pong: Pong!

Gateway Latency: 105ms

vernal snow
#

.xkcd

vivid terraceBOT
vernal snow
#

.xkcd 2347

vivid terraceBOT
#

Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble.

vernal snow
#

there we go

carmine current
vivid terraceBOT
#

Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble.

static hill
#

People hunt rabbits with dogs in the UK

#

@honest pasture I probably know your friend 🙂 I did archery too and the community is very small

jagged granite
#

@buoyant kestrel - I'm here for you

honest pasture
carmine current
honest pasture
#

yeah

#

the first link I clicked too me to an invalid invite

calm bay
#

!e

POINTER = 0
ARRAY = 1
FUNC = 2
INT = 3

T_PTR = (POINTER, None)
T_INT = (INT, None)
T_ARR = lambda x: (ARRAY, x)
T_FUNC = lambda types, ret: (FUNC, (types, ret))

def gen(name, types):
    s = name

    for t in types:
        if t[0] == INT:
            s = f'int {s}'
        if t[0] == POINTER:
            s = f'(*{s})'
        if t[0] == ARRAY:
            s = f'{s}[{t[1]}]'
        if t[0] == FUNC:
            args = t[1][0]
            ret = t[1][1]
            gen_args = [
                gen("", k) for k in args
            ]
            s = f'(*{s})({", ".join(gen_args)})'
            s = gen(s, ret)
    return s

# We emulate a compound type as a "list" of types
#    - pointer to pointer to int is [T_PTR, T_PTR, T_INT]
#    - pointer to int is [T_PTR, T_INT]
#    - int is [T_INT]
#    - array of int is [T_ARR, T_INT]

ifunc = [T_FUNC([[T_INT], [T_INT]], [T_INT])]

print(gen("ptr_to_arr", [T_PTR, T_ARR(10), T_INT]))         # int (*ptr_to_arr)[10]
print(gen("arr_of_ptr", [T_ARR(10), T_PTR, T_INT]))         # int *arr_of_ptr[10]
print(gen("func_ptr", ifunc))                               # int (*func_ptr)(int, int)
print(gen("foo", [T_FUNC([ifunc, [T_INT]], [T_INT])]))      # int foo(int, int)
print(gen("foo", [T_FUNC([[T_INT], [T_INT]], ifunc)]))      # int foo(int, int)
print(gen("nested_arr", [T_ARR(20), T_ARR(10), T_INT]))     # int nested_arr[20][10]
timid fjordBOT
#

@calm bay :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | int (*ptr_to_arr)[10]
002 | int (*arr_of_ptr[10])
003 | int (*func_ptr)(int , int )
004 | int (*foo)(int (*)(int , int ), int )
005 | int (*(*foo)(int , int ))(int , int )
006 | int nested_arr[20][10]
honest pasture
buoyant kestrel
#

What is this, Mustafa?

honest pasture
gloomy lily
honest pasture
#

Many blogging websites, like Jekyll with GitHub Pages, depend on some YAML-formatted metadata at the beginning of your post. You know, the stuff that goes between dashes like this: --- title: Blogging Like a Boss --- Starting today, we’ll render this metadata within GitHub as an horizontal table, for easier reading: This rendering works for […]

carmine current
calm bay
night lily
night lily
#
class MyClass:
    def __init__(self):
        ...```
#

!e py text = "apple" result = text.upper() print(result)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

APPLE
primal bison
#

!e

text = 'UPPERCASE'
result text.lower()
print(result)
#

frick

night lily
#

!e ```py
def func():
print("Hello, world.")

func()
func()
func()```

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Hello, world.
002 | Hello, world.
003 | Hello, world.
primal bison
#

!e

def funcwithvar(var1):
    print(1 + var1)
funcwithvar(5)
night lily
#

!e ```py
def func(arg):
print(arg)

func("Hello, world.")```

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, world.
night lily
#

!e ```py
def display_addition(a, b):
print(a + b)

display_addition(1, 2)```

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

3
primal bison
#

Any tips to optimize?

night lily
#

!zen

timid fjordBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

primal bison
#
for i in [5, 4, 3, 2, 1]:
    print(i)
print('Blastoff')

friends = ['Joseph', 'Aks', 'Rahul']
for friends in friends:
    print('Happy New Year:', friends)
print('Done!')

largest_so_far = -1
print('Before', largest_so_far)
for the_num in [9, 41, 12, 3, 74, 15]:
    if the_num > largest_so_far:
        print(largest_so_far, the_num)
print('After', largest_so_far)

zork = 0
print('Before', zork)
for thing in [9, 41, 12, 3, 74, 15]:
    zork = zork + thing
    print(zork, thing)

found = False
print('Before', found)
for value in [9, 41, 12, 3, 74, 15]:
    if value == 3:
        found = True
    print(found, value)
print('After', found)

smallest = None
print('Before')
for value in [9, 41, 12, 3, 74, 15]:
    if smallest is None:
        smallest = value
    elif value < smallest:
        print(smallest, value)
print('After', smallest)
night lily
#

!code

timid fjordBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

night lily
#

!e py a = "apples" b = "pears" c = a + b print(c)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

applespears
night lily
#

!e py name = "Peter" print(f"Hello, {name}.")

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, Peter.
night lily
#

!e py "abc" + 123

timid fjordBOT
#

@night lily :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: can only concatenate str (not "int") to str
night lily
#

!epy print("abc" + str(123))

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

abc123
night lily
#

!e py age = "16" #user_input = input("How old are you?") age = age + 1 ...

timid fjordBOT
#

@night lily :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: can only concatenate str (not "int") to str
night lily
#

!e py age = "16" age = int(age) print(age + 1)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

17
night lily
#

!e py name = "Peter" age = 16 print(f"Hello, {name}. You are {age} years old.")

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, Peter. You are 16 years old.
night lily
#

!e py name = "Peter" age = 16 print("Hello, " + name + ". You are " + str(age) + " years old.")

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, Peter. You are 16 years old.
night lily
#

f-strings are nicer.

primal bison
#

indeed

#

Fun fact: Teaching other people of the subject you are learning, you'll grow even more then the average joe.

night lily
#

Corey Schafer. Playlists. Python for beginners.

primal bison
primal bison
night lily
#

!e py for i in range(10): print(i)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
night lily
#

!e ```py
for i in range(10):
if i == 5:
break
print(i)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
night lily
#

!e py for i in range(10): if i == 5: continue print(i)

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 6
007 | 7
008 | 8
009 | 9
night lily
#

!e py for i in range(1): break else: print("else")

timid fjordBOT
#

@night lily :warning: Your 3.11 eval job has completed with return code 0.

[No output]
night lily
#

!e py for i in range(1): pass else: print("else")

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

else
night lily
#

!e py while True: #if True: break else: print("else")

timid fjordBOT
#

@night lily :warning: Your 3.11 eval job has completed with return code 0.

[No output]
night lily
#

!e py while False: #if False: break else: print("else")

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

else
night lily
#

Each if stanza consists of the following. ```py
if condition: #If condition is truthy, this if block is run. Exactly one if.
pass

elif some_other_condition: #If none of the above are truthy but some_other_condition is, this block is run. Zero or more elif
pass

else: #If none of the above are truthy, this block is run. Zero or one of these.
pass```In this order. Only one block in an if stanza is triggered per encounter with it.

#

!e ```py
def func():
return 5

v = func()
print(v)```

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

5
night lily
#

!e ```py
def func(arg):
return arg

v = func("apple")
print(v)```

timid fjordBOT
#

@night lily :white_check_mark: Your 3.11 eval job has completed with return code 0.

apple
night lily
#

The call to func, func("apple") is replaced with the object given to return within the function, arg.