#off-topic-lounge-text

1 messages · Page 8 of 1

arctic crypt
primal bison
#

take the input from the user complex number and the greater number between real and imagenery part

primal bison
#

Hello how to download populair streaming sites?

grizzled star
#

who's is a beginner here and is in process of learning python

pallid osprey
#

hey

hardy ore
#

Hello

finite aspen
#

man's really saying hi everywhere

primal bison
drowsy pebble
#

!voice

timid fjordBOT
#
Voice verification

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

next cargo
#

@sour tiger

sour tiger
plain plover
#

ia ma de pula fa

#

parasuto

keen solar
#

why i cant open mice ?

#

i have question

sly axle
#

bro what does x //= 10 mean?

finite aspen
#

x = x // 10

#

assign x to the result of deviding x by ten and flooring

spark echo
#

hey

#

I'm not verified yet sry

queen tiger
#

can we share link here ??

finite aspen
queen tiger
#

it is legel ??

#

@finite aspen hey ??

finite aspen
#

no thanks

queen tiger
spark echo
#

@keen knoll may i ask some help bout my code?

#

I don't know that it's allowed or not

queen tiger
#

its not allowed sorry admin

obsidian pilot
#

imagine adding Chromify Colors

#

is good

vocal basin
#

hiii

ocean nova
#

Is there a community for pair programming here (working small coding challenges, working on projects,etc.)?

If so, could anyone point me in the direction of the correct channel?

drifting gust
#

hy guys

primal bison
#

@night lily I am not yet voice verified so can't speak. I just joined this server today

hearty aspen
#

hi guys any one know iqoptionapi library ?

crystal walrus
#

hello

cinder dust
soft lynx
#

hey guys

may somebody helps me a bit?
i has some stuck with my test code

`#we read 4 lines
response = ""
while response.count('\n') < 4:
response += sock.recv(1024) <-- line 37
#print(response)
#print('')
#get rid of empty lines
responses = [json.loads(res) for res in response.split(',') if len(res.strip())>0]

pprint(responses)

job_id,prevhash,coinb1,coinb2,merkle_branch,version,nbits,ntime,clean_jobs = responses[1]['params']`

File "py_miner.py", line 37, in <module>
response += sock.recv(1024)
TypeError: can only concatenate str (not "bytes") to str

i was try to .decode() it but its fails to with another fault

job_id,prevhash,coinb1,coinb2,merkle_branch,version,nbits,ntime,clean_jobs = responses[1]['params']
ValueError: not enough values to unpack (expected 9, got 1)

#

.
.
any bit of help? any solution?

dull anvil
#

what is the code doing?

#

you can print(responses[1]['params']) to debug

soft lynx
#

to learn more about stratum protocol (bitcoin mining)

#

its their code
i has try to port it from py2 to py3

dull anvil
#

remote server that it polls, might've changed response format

sour silo
clear tide
#

what about the soul?

blazing seal
#
​No Category:
  help Shows this message
  send 

Type !help command for more info on a command.
You can also type !help category for more info on a category.
fading path
#

.help

#

/help

glass mauve
#

hello

#

is anyone can help me about bot

karmic mason
#

eh ¯_(ツ)_/¯

primal bison
#

Oh I have to be on the server for at least 3 days

#

I don't qualify.

elfin wasp
#

привет

magic ridge
#

Hello

#

How you doing guys?

fallow shard
#

hey i always wanted to ask

#

what exactly do you guys even do in a python vc?

#

do u guys just chill or are u working on a project or something?

dull anvil
#

first -- usually; second -- rarely

old cradle
magic ridge
#

I'm good and you?

old cradle
#

all good man

#

I see you've joined recently

#

you a python dev?

magic ridge
#

Yes @old cradle

old cradle
#

!e

print("hello nuraj bro")
timid fjordBOT
#

@old cradle :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello nuraj bro
magic ridge
#

!e

Hello Tomas bro
timid fjordBOT
#

@magic ridge :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     Hello Tomas bro
003 |           ^^^^^
004 | SyntaxError: invalid syntax
magic ridge
#

It's not working @old cradle bro

old cradle
#

!e

x = 1
y = 1
print(x+y)
timid fjordBOT
#

@old cradle :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
old cradle
magic ridge
#

Nice @old cradle bro

deep quartz
#

hi

magic ridge
#

Hello

deep quartz
#

which year?

magic ridge
#

What which year?

deep quartz
#

college or job?

magic ridge
#

Oh I am working right

#

Now

deep quartz
#

which company

magic ridge
#

Where are you from?

deep quartz
#

delhi

magic ridge
#

Uptechsys Pvt ltd

#

It's in Nepal

#

Oka

deep quartz
#

oky

#

so u r from nepal?

magic ridge
#

What about you??

#

Yes I am

#

What you do?

deep quartz
#

delhi

#

i have sent you friend req check

magic ridge
#

Okay wait

#

I have accepted 😊

#

Hello @old cradle

old cradle
#

where are you from

magic ridge
#

I am from Nepal

#

And you?

old cradle
#

ma pani nepali ho nee bro

magic ridge
#

Lau hora

#

Kata Dekhi hota bro

old cradle
#

kathmandu ho nee

magic ridge
#

Mani Kathmandu nai ho yr

old cradle
#

la hora bhanya

#

where in kathmandu?

magic ridge
#

Honi

#

Ma kapan dekhi ho tme Kata Dekhi hota

old cradle
#

me too from kapan bruh

magic ridge
#

Okay

tame spoke
#

Hi guys

#

Hi @shut marlin

shut marlin
#

hi

tame spoke
#

how are you?

shut marlin
#

i am as always

#

how about you

tame spoke
#

I am as always depressed ?

shut marlin
#

what are you upto?

#

its a channel for live coding so

#

i think its inappropriate to text random stuff here

tame spoke
#

Sorry for that.

#

I am new in this channel so I haven't much idea.

#

If there is random channel

#

to talk like this

#

please ping me ok.

shut marlin
#

ah its fine

tame spoke
#

Thanks!

west flame
#

Guys, do you know if is it possible to search one word across a text line more than one time? I mean, if I have GATAGATGGACTATAAGATGATATAAGA and use find on TATAA it will tell me the index corrisponding only to the first TATAA, but I want to know all the positions.

#

hope this is a right channel to ask

copper nest
#

Yes

west flame
#

How can I do that?

lusty saddle
#

i guess it wil give the result of this log text

#

u've written

west flame
#

I want to know all my TATAA positions, that's the problem

spiral dock
# west flame
import re

teststr = 'GATAGATGGACTATAAGATGATATAAGA'
pattern = 'TATAA'

matches = re.finditer(pattern, teststr)
number_of_matches = len(list(matches))

print("Total number of matches:", number_of_matches)
#

Anyone around? I am trying to do a POST request to an API to upload a file... I think I really just need help understanding the API (https://doc.nitrado.net/#api-Gameserver-GameserverFilesUpload). I successfully do a POST to the API and I get a 201 status code back but the API says I should get a 200. but regardless I get the response back that they say I should.. This is from their docs json HTTP/1.1 200 OK { "status":"success", "data":{ "token":{ "url":"http://dev001.nitrado.net:8080/upload/", "token":"8c3ff9b4-b222-4d30-87ae-9dd6a7c0d1d7" } } } the only difference is mine is a 201 and not a 200. but the file on the ftp server isn't changed after the request. Is there something that I am supposed to do with the URL and TOKEN that I receive from the original post request?

west flame
#

Maybe a loop where the system slices the sequences by 1 from 0 and find(mysequence) every time by the lenght of my sequence could work, but don't know imma try myself

west flame
#

text = 'Allowed Hello Hollow'

index = 0
while index < len(text):
index = text.find('ll', index)
if index == -1:
break
print('ll found at', index)
index += 2 # +2 because len('ll') == 2

ll found at 1
ll found at 10
ll found at 16

#

I found this online

spiral dock
# west flame ok, but I need to know where (index) are all my TATAA sequences. I aim to an out...

The match.start() method returns the starting index of the match, and you can iterate through all the matches using a loop and print their respective indices. This code will output:```python
import re

teststr = 'GATAGATGGACTATAAGATGATATAAGA'
pattern = 'TATAA'

matches = re.finditer(pattern, teststr)

for match in matches:
start_index = match.start()
print(f"'{pattern}' appears at index:", start_index)

#
'TATAA' appears at index: 21```
west flame
#

Thx bro, I didn't know that command

spiral dock
#

your good! we are all learning!

west flame
#

now I am trying to do an input command for pattern(s)

spiral dock
# west flame now I am trying to do an input command for pattern(s)

like this? ```python
import re

def find_pattern_occurrences(text, pattern):
occurrences = re.finditer(pattern, text)
return [match.start() for match in occurrences]

Get input from the user

text = input("Enter a text: ")
pattern = input("Enter a pattern: ")

Find occurrences of the pattern in the text

occurrence_indices = find_pattern_occurrences(text, pattern)

if occurrence_indices:
print(f"Pattern '{pattern}' found at indices: {occurrence_indices}")
else:
print(f"Pattern '{pattern}' not found in the text.")

versed wagon
#

hiii

west flame
#

hi

dull anvil
spiral dock
primal bison
primal bison
primal bison
tender sphinx
#

By pip

primal bison
dull anvil
primal bison
dull anvil
#

ctrl+shift+p
select interpreter

primal bison
open granite
#

Can anyone who may have saved some of my work help me get it back?

potent wharf
#

@glad topaz did you do algo trading ?

glad topaz
#

no lol

potent wharf
glad topaz
#

yeah

potent wharf
#

which year

#

@glad topaz what kind of project is this?

glad topaz
potent wharf
#

@glad topaz @sonic pasture bye guys

outer osprey
#

@hollow lake can't speak in vc yet, no permissions

#

call private?

leaden pier
#

@outer osprey do !voice

#

!voice

crude bolt
#

hello!

undone shore
#

hello!

crude bolt
#

hello

#

hru

vernal field
#

sorry about that

#

that was mildly embarassing lemon_sweat

jade beacon
#

!voice

timid fjordBOT
#
Voice verification

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

outer osprey
jade beacon
#

no way

#

that aint default

jade beacon
#

for default

outer osprey
#

idk then soz dont remmeber changing it

jade beacon
#

nvm i found it

#

its called defualt+ something

primal bison
#

use PyCharm

#

nah but srsly idk

primal bison
sacred parcel
#

Exception has occurred: TypeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
replace() argument 2 must be str, not Series
File "C:\python\Scripts\BW_Translate.py", line 60, in <module>
AcctName = AcctName.replace(key,value)

faint star
#

to replace a dict value you would call its key value

dict['key'] = value
#

this assigns a new value to that key

proper cobalt
proper cobalt
brazen wave
#

hey @night lily

#

@night lily how are you?

lavish solar
#

Any lua gods?

#

Im trying to run a function in a different file, but the filename is the same as the plugin name, so when I require it, it is requiring the plugin file instead

brazen wave
#

Leetcode is my religion
-- Gi classic banter

stoic coral
#

hey guys

cerulean jackal
#

Hey

sonic pasture
#

silent gang

cerulean jackal
#

fr

#

What are y'all working on?

stoic coral
#

i am here to learn guys i love to get your helps

sonic pasture
#

mailing scripts 😢

cerulean jackal
#

ello

#

Hello People

wide aurora
#

☕ 🍵

#

🔓🔒🔐🔏

unborn sorrel
#

Gotta make some lunch here. Cheers

buoyant kestrel
#

Back in a sec, have to migrate someone's computer.

buoyant kestrel
#

They're moving out of one office into another

left jetty
#

Hi, I am finding this erro

#

AttributeError: 'int' object has no attribute 'next'

#

please help me out

grand jolt
#

does anyone familiar with code Wars problem solving

brazen wave
#

@chilly spear I mentioned the NDVI index

#

for vegetation

#

about my microphone yes.. it's not the best

quiet jacinth
#

okay my thing is solving all of them...

import json
import os
from libs import solver

class Data: 
    dirs_path: str
    dirs_key: str
    strings_path: str
    samples: list[str]
    strings: list[str]
data = Data()
data.dirs_path = "./dirs.json"
data.dirs_key = "samples"
data.strings = []
data.strings_path = "./strings.txt"

def get_samples_directories():
    with open(data.dirs_path, "r") as f:
        samples_path = dict(json.load(f)).get(data.dirs_key)
        samples = [os.path.join(samples_path, sample) for sample in os.listdir(samples_path)]
    data.samples = samples

def get_texts():
    for i, sample in enumerate(data.samples):
        print(" "*54, f"{i}/8049", end="")
        data.strings.append(
            solver.get_answers(sample)[0][1]
        )

def save_strings():
    with open(data.strings_path, "w") as f:
        f.writelines((f"{s}\n" for s in data.strings))

def main():
    get_samples_directories()
    get_texts()
    save_strings()
    # print(*data.strings, sep="\n")


if __name__ == "__main__":
    main()

#

oh no looks like my solver doesnt remove image cash
ohno
anyway

runic forge
#

still better than how i code

quiet jacinth
#

got them, sadly cant upload

grand jolt
#

what do you guys doing

cerulean jasper
jaunty robin
#

@buoyant kestrel

#

hii

buoyant kestrel
#

Yo. So unfortunately, since you're still fresh to the server, I typically don't grant streaming role. Typically. What're you working on currently?

jaunty robin
#

i am learning python i started today im learning basics like, if, etc

#

and i do need help sometimes

#

so i though i could request help

#

if i cannot continue

#

just streaming for fun

#

is it ok if i share for bit? or smth im on vc called live coding, if not then how can i achieve the role?

buoyant kestrel
#

Oh for sure. I'm happy to help when you need it. And I try to grant temporary/probationary stream permissions after we get comfortable with folks

jaunty robin
#

oo tyy

#

so i ask u if i have questions in ur dms?

buoyant kestrel
#

Just ping me if I'm around

#

Always happy to help.

jaunty robin
buoyant kestrel
#

That'll tell you about the voice gate specifically

jaunty robin
#

oh thanks

buoyant kestrel
#

For the streaming, I typically grant it on an as needed basis when people want/need help or are wanting to show off their code and what have you

#

As we see that people can be responsible, we grant them the permission for a probationary period (typically 3 weeks). And if they show to be responsible after that, perma

jaunty robin
#

oh thanks for explaining

#

will get back to coding see u

buoyant kestrel
#

Have a good one

jaunty robin
#

car = 400
plane = 100
if car > plane:
print("car is greater than plane")

#

am i allowed to send codes here

buoyant kestrel
#

Of course. You'll use the built in markup that Discord has

timid fjordBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

jaunty robin
#

uh

river root
#

i forgot the py half the times

buoyant kestrel
#

Oh it's the backtick, same key as the ~, next to 1 on the number row

#

On US keyboards, anyway

jaunty robin
#

!code
~car = 400
plane = 100
if car > plane:
print("car is greater than plane")

timid fjordBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

river root
#

the key next to enter

#

`

jaunty robin
#

'

river root
#

on eu

#

its needs a angle

buoyant kestrel
#
print('Hello world!')
jaunty robin
#

got it

#

.

#

im so dumb

river root
#

`

jaunty robin
#

anyway leave it to me will figure it out

#

LOL

buoyant kestrel
#

And then the closing 3 ticks

river root
#

copy 3 of thse

buoyant kestrel
#

Yeah it's annoying at first

jaunty robin
#

kk

#
car = 400
plane = 100
if car > plane:
 print("car is greater than plane")```
#

like this

buoyant kestrel
#

Boom

river root
#
print("Hello world")
jaunty robin
#

i figured why its cus i dont have ```

#

keys

#

i got '''

#

.

#

nvm

#

found

buoyant kestrel
#

Yeah that's an unfortunate thing- HA

river root
#

u sure they arent hidden?

jaunty robin
#

hi

buoyant kestrel
#

No worries

jaunty robin
#

!code

plane = 100
if car > plane:
 print("car is greater than plane")```
timid fjordBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

river root
#

u need py

#

in the first `

jaunty robin
#

i did !code ``` py

#

without space

river root
#

no code

buoyant kestrel
#

The py has to be next to the first 3 ticks, no spaces on either side

#

And the code needs to be on the following lines

#

But yeah, you don't need the !code

#

That's just for brining up the embed

jaunty robin
#

kk

#

ok

#

got it

#

ty

river root
#
choices = get_choices()
result = check_win (choices["player"],choices["computer"])
print (result)
jaunty robin
#
car = 400
plane = 100
if car > plane:
 print("car is greater than plane")```

could this be correct
river root
#

to do what

jaunty robin
#

nothing just practicing

#

im using python conditions

river root
#

yea its right

jaunty robin
#

what could elif means?

#

mean*

river root
#

else if

jaunty robin
#

oh thanks

river root
#

u could this do this aswell

#
car = 400
plane = 100
if car > plane:
 print("car is greater than plane")
else:
 print ("plane is greater than car")
jaunty robin
#
car = 400
plane = 100
if car > plane:
 print("car is greater than plane")
 elif car == plane
print("car and plane are equal")```
#

oh

river root
#

u just have 2 things

#

if the first isnt right just do else

#

or elif

#

also wrong indentacion

jaunty robin
#

dang

#

i started today i rlly wanna learn

#

but its hard learning alone

buoyant kestrel
#

Anything in a if elif else chain need to be on the same margin line

river root
#

im still learning but i like cs50

buoyant kestrel
#

And that's why we're here to help

river root
#

the guy is good at explaining

buoyant kestrel
#

Oh there's also some great resources listed on our site

#

!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.

buoyant kestrel
#

I typically recommend "A Byte of Python", which is free on its respective site.

#

There's also youtube channels that are solid if that's more your style

river root
#

there is also a cs50 focused on python

buoyant kestrel
#

And of course, you can always ask us here and we can help explain concepts and what have you

buoyant kestrel
jaunty robin
#

k tysm

#

kk*

buoyant kestrel
#

I always thought it was just a section of CS50 rather than the whole thing

river root
#

Learn Python programming from Harvard University. It dives more deeply into the design and implementation of web apps with Python, JavaScript, and SQL using frameworks like Django, React, and Bootstrap. Topics include database design, scalability, security, and user experience. You will learn how to write and use APIs, create interactive UIs, a...

▶ Play video
river root
#

but this one is more indepth

#

and i like the muppets

buoyant kestrel
#

Very cool, I'll have to bookmark that

jaunty robin
#
car = 400
plane = 100
if car > plane:
  print("car is greater than plane")
elif car == plane:
  print("car and plane are equal")```
buoyant kestrel
#

Muppets are always a plus

jaunty robin
#

yayy

#

it works

#

when i switch car to 100 aswell

river root
#

why do u have elif car == plane:

jaunty robin
#

it says equal

river root
#

nvm

jaunty robin
#

?

#

i can also make plane is greater

#

right?

#

lemme give it a shot

river root
#

u can now do a else to make plane > car

buoyant kestrel
#

An else would cover that case, yeah

#

Since if it's not bigger or equal, it'd have to be smaller

jaunty robin
#
car = 100
plane = 100
if car > plane:
  print("car is greater than plane")
elif car == plane:
  print("car and plane are equal")
elif car < plane:
print("plane is greater then car")```
river root
#

is there a problem if u dont end a if with else? @buoyant kestrel

jaunty robin
#

i didnt do

#

something

#

correct

river root
#

u dont need elif car<plane

jaunty robin
#

hm

river root
#

couse thats the only option remaining

#

u only need elif

jaunty robin
#

oh

#

so basically elif ...?

river root
#

or a else

jaunty robin
#

else

#

oh

river root
#

if its the final

jaunty robin
#

i got it

#

lemme try

#
car = 100
plane = 100
if car > plane:
  print("car is greater than plane")
elif car == plane:
  print("car and plane are equal")
else:
print("plane is greater then car")``` still didnt do something correct
river root
#

do u have python in your pc?

jaunty robin
#

yeah

#

i like visual

river root
#

nice

#

u can make a madlibs with just if and else

buoyant kestrel
#

I do love me some madlibs

river root
#

and a f string

jaunty robin
#

car = 100
plane = 100
if car > plane:
print("car is greater than plane")
elif car == plane:
print("car and plane are equal")
else:
print("plane is greater then car")

#

it doesnt work

#

oops i forgot ``````

river root
#

print isnt indented

#

needs to be inside the else

jaunty robin
#

how do i do that

#

nvm

#

got it

river root
#

i have a extension that makes indent more collorfull

jaunty robin
#

its inside now

#

may i see it

#

btw

#

here

#
car = 200
plane = 100
if car > plane:
  print("car is greater than plane")
elif car == plane:
  print("car and plane are equal")
else:
  print("plane is greater than car")```
#

btu it still doesnt work

#

im trying to figure out why

river root
#

it works

jaunty robin
#

dont i have to do else car < plane and then print inside of it

river root
#

says car and plane are equal

jaunty robin
#

wth

#

it doesnt for me

#

lemme retry

#

yay

#

it works

#

should i make it more difficult?

#

aadding one more

#

want me to share screen in dms i wont talk my mic broken

#

hemlock is it ok if i add u friends

buoyant kestrel
#

!stream 724651365531385919

timid fjordBOT
#

✅ @jaunty robin can now stream until <t:1694535576:f>.

jaunty robin
#

wow

#

tysm

#

okk

#

i use this site

#

im making it more difficult lol

river root
#

u could make it prettier and shorter

jaunty robin
#

how?

#

yo whats going on here lol

#

oo fixed

#

ok

#

.

#

my ear

#

yo

#

what i do

river root
#

about your ear?

jaunty robin
#

no

#

about last part "else"

#

the equal thing

#

im so confused help

#
car = 100
plane = 100
jayy = 100
if car > plane and jayy:
    print("car is greater than plane and jayy")
elif plane > car and jayy:
    print("plane is greater than car and jayy")
elif jayy > plane and car:
    print("jayy is greater than plane and car")
else jayy```
#

idk last part

#

to do equal

#

what do i do?

empty night
#

no its just else:

#

cant do statements as far as i know

jaunty robin
#

else

#

ok

#

thanks

#

yay

#

works

#

thanks

#

car = 150
plane = 200
jayy = 100
if car > plane and jayy:
    print("car is greater than plane and jayy")
elif plane > car and jayy:
    print("plane is greater than car and jayy")
elif jayy > plane and car:
    print("jayy is greater than plane and car")
else:
    print("car, plane, jayy are equal to eachother")```
#

hemlock

buoyant kestrel
#

So minor issue

jaunty robin
#

my streaming time

#

its time up

#

its past 19 minute

buoyant kestrel
#

Yep. The time removes the role , it doesn't kick you off

#

That's intended

jaunty robin
#

oh

#

kk

#

do i unshare

#

or what

#

or am i able to keep sharing

#

will redo this to make sure i memorized the code

buoyant kestrel
#

You can keep sharing. The time is just to give you prep time to start streaming and to keep you from streaming again once you're done

buoyant kestrel
jaunty robin
#

done

jaunty robin
#

to typing

#

lol

river root
#

now for the next bit u can ask input from the user

#

and do float and int

jaunty robin
#

works

jaunty robin
#

i dont got any idea

#

about these

#

can u teach me

#

?

river root
#

we can see everything u do btw

#

yea

jaunty robin
#

tysm

river root
#

instead of having a number

#

do input("ask something")

#

withouth the do xD

jaunty robin
#

ik haha

#

liek that?

river root
#

yea

jaunty robin
#

i got idea

#

lemme try it

#

uh

#

how do u do when u ask how old am i

#

and it answers

#

with number

river root
#

a = input

jaunty robin
#

hm

river root
#

then u print a

jaunty robin
#

kk

river root
#

your printing the letter a

jaunty robin
#

kk

#

i wrote code hour or two ago

#

similiar

#

i cant remember

#

friend of mine helped me

river root
#

do print(a)

jaunty robin
#

aa

#

kk

#

done

#

its my first time using input

#

i started learning today

#

just hour or two ago

#

how do i do so it answers

potent wharf
#

Install code runner

jaunty robin
#

the question "how old am i"

potent wharf
#

Extension

jaunty robin
river root
#

in the same place

jaunty robin
#

installing

potent wharf
jaunty robin
#

done

river root
#

poor guy getting 5 milliong things

jaunty robin
#

no

#

georgia

river root
#

dont ddos yourself

potent wharf
#

Ok

jaunty robin
#

huh ddos?

river root
#

run the program

#

and type where its says whats my age

jaunty robin
#

kk

river root
#

at the bottom

jaunty robin
#

got it

#

like that

#

?

river root
#

yea

jaunty robin
#

oo

river root
#

it gave u the response that u gave it

jaunty robin
#

thats cool

#

more advanced now?

river root
#

@buoyant kestrel teaching him input

jaunty robin
#

sorry i dont hear well

buoyant kestrel
#

Very good

river root
#

try and type 2.4

jaunty robin
#

2.4?

river root
#

yea when it ask for age

jaunty robin
#

oh kk

#

it says "a"

potent wharf
#

Remove the quote

#

Print(a)

jaunty robin
#

hemlock my sound is broken

#

so i dont hear well

buoyant kestrel
#

So when you did print("a"), it is printing the string literal "a"

#

Not the variable a

jaunty robin
#

oh

#

so

#

print(a)

potent wharf
buoyant kestrel
#

Yeppers

jaunty robin
#

alr

#

ty

potent wharf
#

It's a variable

jaunty robin
#

it works

river root
#

i was expecting to break couse its a float xD

jaunty robin
#

a

buoyant kestrel
#

So anything that you send into input() will always be recorded as a string

#

Always always

jaunty robin
#

oo ok

buoyant kestrel
#

And you have to convert it yourself if you want it to be a different type

potent wharf
#

@jaunty robin buddy you watch the tutorial

buoyant kestrel
#

Did we explain the and gotcha?

jaunty robin
#

watching now

jaunty robin
buoyant kestrel
#

!and-gotcha

#

Wait

jaunty robin
#

i dontk now thta

#

oops

#

my stream gone

timid fjordBOT
#
The or-gotcha

When checking if something is equal to one thing or another, you might think that this is possible:

# Incorrect...
if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
jaunty robin
#

my stream closed

#

rip

buoyant kestrel
#

let me know when you're done with the vid and we can reup it

jaunty robin
#

oh kk

potent wharf
buoyant kestrel
#

Oh right right

potent wharf
#

You will understand basic in starting 2-3 hrs

#

It's also have notes you will like it

buoyant kestrel
#

Ehhhh

potent wharf
jaunty robin
#

i will watch for like

#

15 minutes

river root
#

Learn Python programming from Harvard University. It dives more deeply into the design and implementation of web apps with Python, JavaScript, and SQL using frameworks like Django, React, and Bootstrap. Topics include database design, scalability, security, and user experience. You will learn how to write and use APIs, create interactive UIs, a...

▶ Play video
jaunty robin
#

cus

river root
#

this one better

jaunty robin
#

when its explained here in text its ez

buoyant kestrel
#

I still recommend sites and books

jaunty robin
#

yeah

#

videos annoying

buoyant kestrel
#

I don't do well with vids

jaunty robin
river root
#

different people

buoyant kestrel
river root
#

reading something isnt for me

buoyant kestrel
potent wharf
buoyant kestrel
#

To each their own

potent wharf
buoyant kestrel
#

Certs really don't mean much for programming

#

IT they do

#

Less so for coding

jaunty robin
#

is reading on site allowed while sharing?

buoyant kestrel
#

Oh sure sure

jaunty robin
#

oo thanks

buoyant kestrel
#

!stream 724651365531385919

timid fjordBOT
#

✅ @jaunty robin can now stream until <t:1694537772:f>.

fresh sail
jaunty robin
#

oops sorry

#

i was afk

buoyant kestrel
#

All good

river root
#

CAN

buoyant kestrel
#

They have a dark mode on the Byte of Python site

#

If you prefer

jaunty robin
#

sure

#

where

buoyant kestrel
#

Looking

#

Scroll up to the very top of the page

#

Top left hand corner

#

The A

#

Yeah you got it

jaunty robin
#

oh thanks

#

tyy

#

oops

#

mystream closed

potent wharf
#

Now you can run that file check out run button

jaunty robin
#

?

buoyant kestrel
#

!stream 724651365531385919 30M

timid fjordBOT
#

✅ @jaunty robin can now stream until <t:1694539677:f>.

jaunty robin
#

yo whats this

fresh sail
jaunty robin
#

wth

river root
#

something they are talking about

jaunty robin
#

what is debug

#

i meant

#

where is debug and run

#

wheres debug

#

my sound

#

is broken

river root
#

the red arrow next to name

buoyant kestrel
#

Click that arrow

jaunty robin
#

fixed

#

ty

buoyant kestrel
#

That's a breakpoint

#

That tells the debugger to stop at that line so you can see what's going on in the program

jaunty robin
#

the name part so confusing

buoyant kestrel
#

But in our case, we don't need to worry about that

jaunty robin
#

in book

potent wharf
#

Check there is drop down arrow like it can run python file

jaunty robin
#

sec

buoyant kestrel
#

So the name thing

jaunty robin
#

yh

buoyant kestrel
#

When you were doing name + ... and it was throwing an error, it was because name was not defined ahead of time

#

So it didn't know what you meant by name

jaunty robin
#

oh

buoyant kestrel
#

When we add name = "blah" above that, then it knows

#

The book kind of expects you to follow along with all the input so that you have those things ready to test and play with

jaunty robin
#

ok

potent wharf
jaunty robin
#

?

buoyant kestrel
#

Doing "Run without Debugging" will be a bit quicker

#

So CTRL + F5

jaunty robin
#

oh

#

kk

#

ctrl f5 doesnt work for me

buoyant kestrel
#

Weird

#

Either way, that's the selection I'd use for this for now

#

Debugging adds some extra things running that you don't need to worry about at the moment

#

I'm dumb

#

I totally forgot the little play button in the top right hand corner

#

Thanks to Torbjorn for reminding me

jaunty robin
#

a

#

u mean this button

buoyant kestrel
#

Yeppers

jaunty robin
#

kk

potent wharf
jaunty robin
#

got it

#

how do i make so "enter your ussername" and u can answer it with ur name after

#

.

river root
#

input?

jaunty robin
#

i didnt make sense

#

lol

#

input

#

ok

buoyant kestrel
#

input('Enter your name: ')

#

Any argument you give input will show up as your prompt

jaunty robin
#

thanks

#

a is equal to inpu

buoyant kestrel
#

Any time you do an input, you have to make sure you have something to catch it

#

Yep

#

Remember, one equals sign (=) is assignment, two (==) is comparison

jaunty robin
#

huh

river root
#

go to first line

jaunty robin
#

wait

jaunty robin
river root
#

and do a = input

jaunty robin
#

oo

#

annoying

#

sec

#

back

potent wharf
jaunty robin
#

kk

potent wharf
#

what you want to do

jaunty robin
#

wow

#

works

jaunty robin
#

tor my soundis broken

#

remember lol

#

i dont hear well

jaunty robin
#

box

#

small box*

buoyant kestrel
#

In terminal or as a separate window?

jaunty robin
#

uhh

#

idk

#

which easier

buoyant kestrel
#

Terminal

potent wharf
buoyant kestrel
#

Hands down

jaunty robin
#

kk

#

terminal

buoyant kestrel
#

Well

#

Actually hold on, can you describe what you mean

river root
#

u can make a madlibs, which is a few sentances and take some words out and ask the person what those words are and check if they are right or wrong

buoyant kestrel
#

I may be thinking a different thing

jaunty robin
river root
#

a actual window?

jaunty robin
#

uhh maybe

#

is that possible

buoyant kestrel
#
---
Enter your name: 
---

Something like that?

jaunty robin
#

yeah

#

and age

buoyant kestrel
#

Just put prints between your inputs

river root
#
from turtle import *


hideturtle()
color('black', 'green')

def left_turn():
    for i in range(10):
        forward(15)
        left(9)
        
def petal():
    begin_fill()
    left_turn()    
    left(90)       
    left_turn()
    left(90) # Line added 
    end_fill()

for i in range(50): 
    petal()
    right(36/5)
bye()
jaunty robin
#

wth

buoyant kestrel
#

Like a new print between the two input statements

#

Or around it, however you want it to look

jaunty robin
#

YO WTF

buoyant kestrel
#

Yeah, turtle is a primitive drawing library built into Python

#

It's fun

jaunty robin
#

CAN I LEARN THIS LOL

buoyant kestrel
#

Of course

potent wharf
#

yes

buoyant kestrel
#

Think of it as just telling a pen where to go and what to draw

#

But with code

river root
#

if u wanna mess with the code, change the left or fowards numbers

jaunty robin
#

.

#

YAY IT FINISHED

#

MY LIFE IS COMPLETE NOW

#

A

#

LOL

#

wtf

buoyant kestrel
#

Debug will make it be slower

jaunty robin
#

.

buoyant kestrel
#

Ooo pretty

potent wharf
jaunty robin
#

ay

river root
#

do # before the hiddleturtle line

jaunty robin
#

are u able to do random color

#

lool

#

kk

potent wharf
#

Import random

jaunty robin
#

?

river root
#

run it for now

jaunty robin
#

.

#

Ayo arrow

river root
#

thats the turtle

#

.# makes it a comment which python ignores

jaunty robin
#

ok

#

how do i learn turtle

#

😎

river root
#

dont ask me

jaunty robin
#

ay my mom talkin

#

callin

#

brb

dire tusk
#

excellent exercise to understand the POO

jaunty robin
#

aw man i gotta shower

#

a

#

a

buoyant kestrel
#
from random import randint

r, g, b = [randint(0, 255) for _ in range(3)]

pencolor(r, g, b)
#

Something like that, but in the loop

#

You'd have to do the rest

jaunty robin
#

how do i do

#

enter ur name

#

and password

buoyant kestrel
#

input

jaunty robin
#

uhh

buoyant kestrel
#

input("Please enter your username: ")

#

But assigned to something

#

If that's what you meant

jaunty robin
#

im sooooooo confused

#

lol

river root
#

the turtle isnt moving couse u didnt give it commands

jaunty robin
#

oh

#

what commands i give it

buoyant kestrel
#

Hold on, I'll modify Tor's code

jaunty robin
#

😎

#

im so good at this

#

no cap

#

y owtf

#

i dont wanna be gae

buoyant kestrel
#
from random import randint
from turtle import *


hideturtle()
color('black', 'green')

def left_turn():
    for i in range(10):
        forward(15)
        left(9)
        
def petal():
    begin_fill()
    left_turn()    
    left(90)       
    left_turn()
    left(90) # Line added 
    end_fill()

for i in range(50): 
    r, g, b = [randint(0, 255) for _ in range(3)]
    fillcolor(r, g, b)
    petal()
    right(36/5)
bye()
#

Think that'd work?

jaunty robin
#

.

#

im not learning alldat in 1 year

#

wth

#

it gonna take me year or two

buoyant kestrel
#

Well we got sidetracked with Turtle

jaunty robin
#

my brain ded

buoyant kestrel
#

And it's alwasy good to sleep on stuff, let it soak in

#

Regular breaks are helpful

#

My bad

jaunty robin
#

a

buoyant kestrel
#

But I think we're getting side tracked from the basics

#

I'd say back to A Byte of Python for now

#

Can futz with turtle more later

river root
#

a good thing to learn is def

jaunty robin
#

FINISHED!!!

jaunty robin
river root
#

u can save that file and come back to it later

#

u can make a new function with def

jaunty robin
#

okk

#

sure

#

teach me deaf

#

i meant def

river root
#

ask mr.hemlock

jaunty robin
#

@buoyant kestrel

fresh sail
#

Python > Excel

buoyant kestrel
#

Oh yes yes

#

Give me a moment, trying to do a work thing

river root
#

u should go back to python basics @jaunty robin

jaunty robin
buoyant kestrel
#

Yeah, A Byte of Python will cover functions (which is what def is for)

river root
#

get indent rainbow interface

night lily
#

!e py def func(): # I create a function object and point the variable, func, at it print('Hello, world.') # I here say what this function does when it is run/'called' print('Goodbye.') #Function ended. Note the indent levels. func() #I call/run the function.

timid fjordBOT
#

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

001 | Hello, world.
002 | Goodbye.
river root
#

i mean extensions

jaunty robin
#

!e

empty night
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 formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

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

Currently only 3.11 version is supported.

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

jaunty robin
#

..

buoyant kestrel
empty night
#

yes

buoyant kestrel
#

Which isn't helpful for teaching folks the basics

jaunty robin
#

hemlock is it ok if i reshare

buoyant kestrel
#

Reshare?

jaunty robin
#

yeah

#

unshare and share again

buoyant kestrel
#

Oh yeah

jaunty robin
#

i wanna check smthprivate

#

thanks

buoyant kestrel
#

!stream 724651365531385919

timid fjordBOT
#

✅ @jaunty robin can now stream until <t:1694541258:f>.

buoyant kestrel
#

Or did you mean like later

night lily
#

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

argument = 'Hello, world.'
func(argument)```

timid fjordBOT
#

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

Hello, world.
jaunty robin
#

thnks

buoyant kestrel
#

Yarp

jaunty robin
buoyant kestrel
#

Righto

jaunty robin
#

whats

#

the thingy

#

wait i forgot the name of it 💀

#

def

#

@jaunty robin hi jay

river root
#

what u want

jaunty robin
#

uh

#

def

night lily
#

Functions can have a sort of "inbox" or "inboxes", called 'parameters'.

jaunty robin
#

thing

#

but before that

#

can u give me task to do

buoyant kestrel
#

So def is used for making functions

jaunty robin
#

with print or input

buoyant kestrel
#

Functi- Opal is beating me to it

jaunty robin
#

practice

night lily
#

To these parameters, we give arguments. Objects given to the call to that function.

buoyant kestrel
#

I declare Opal as my official assistant in my sted

river root
#

with def u can make custom functions

jaunty robin
#

definitely

river root
#

so if your doing something over and over, make a function that does that for u

#

@jaunty robin try and look at this and see what it means

#
import random

def get_choices():
    player_choice = input ("Enter a choice (rock paper scissors:")
    options = ["rock","paper","scissors"]
    computer_choice = random.choice(options)
    choices = {"player": player_choice,"computer": computer_choice}
    return choices

def check_win(player,computer):
    print (f"You chose {player}, computer chose {computer}")
    if player == computer:
        return "Its a Tie"
    elif player == "rock":
        if computer == "scissors":
            return "Rock destroys scissors! Player wins"
        else:
            return "Paper destroys Rock! Player losses"
    elif player == "paper":
        if computer == "Stone":
            return "Paper destroys Rock! Player wins"
        else:
            return "Scissors destroys Paper! Player looses"
    elif player == "scissors":
        if computer == "Paper":
            return "Scissors destroys Paper! Player wins"
        else:
            return "Rock destroys scissors! Player looses"
                
choices = get_choices()
result = check_win (choices["player"],choices["computer"])
print (result)```
jaunty robin
#

NAH WHAT

night lily
#

!e ```py
def func():
return 'Hello.'

print(func())```The call of a function is replaced by the object given to return, within the function.

timid fjordBOT
#

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

Hello.
jaunty robin
#

ez

#

tie

#

i win

night lily
#

This is like the function's "outbox"

jaunty robin
#

i win

#

again

#

yo am i able to do

#

nvm

#

cant explain

#

too trash english

#

a

river root
#

u can pretty much read the code

jaunty robin
#

r u able

#

to make game

#

in new tab

#

in python

river root
#

new tab, u mean new file?

jaunty robin
#

no

#

like turtle

#

thing

#

when it opens new window

night lily
#
import random
while True:
    result = random.choice(['win', 'lose'])
    input('Rock, paper or scissors? >')
    print(f'You {result}!')```
river root
#

u can see def check win, checks if u win or loose, and def get choices gets the choices from the player and computer

night lily
#

All functions that complete return.

#

If nothing is explicitly given to be returned, None is returned.

river root
#

i'd say go learn the basic before u make any game

jaunty robin
#

YOO PING PONG GAMAE

night lily
#

!e ```py
def func():
print('Hello!')

result = func()
print(result)```

jaunty robin
timid fjordBOT
#

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

001 | Hello!
002 | None
jaunty robin
#

aw doesnt work

#

thats so cool

#

it doesnt work

night lily
#

It is in this way important to recognise the distinction between printing and returning, because in some cases, it can be difficult to see the difference.

#

Do you have any questions about def so far?

jaunty robin
#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

#

I LOST

night lily
#

Very well.

jaunty robin
#

i go sleep

river root
#

i dont think hes paying attencion

jaunty robin
#

.

#

i didnt see

#

i was playing

#

snake game

#

snake ate himself

#

i gotta

#

sleep

buoyant kestrel
#

Get some rest

jaunty robin
#

cyaa

fresh sail
river root
jaunty robin
#

heyy

#

@buoyant kestrel

#

yoo

#

im back

#

u on?

#

aw

#

rip

jaunty robin
#

hey

river root
#

hes busy in another vc

jaunty robin
#

hey @unborn sorrel

#

is it ok if i share for bit?

#

with quan

unborn sorrel
jaunty robin
#

?

#

i mean hemlock granted me role yesterday and before yesterday

#

in purpose of learning coding

#

and sharing

#

to get more knoweldge from others and tips