#voice-chat-text-0
1 messages ยท Page 376 of 1
This probably means that Tcl wasn't installed properly.
@tawdry jungle ๐
a bit of it
mostly the language itself, not the standard library
I'm more aware of principles behind STL than of its contents
@tawdry jungle is there any specific C++ question you have?
when initially studying the language, I've mostly used the reference, but it's not very beginner-friendly
https://en.cppreference.com/w/cpp
^ they have exampes, and those are sometimes useful
I'm aware of that channel but never watched it
most of those are in C too (not just C++)
C has way less conveniences and safeguards
nowadays it's recommended to write code using a C++ compiler even if you intend on only using C features
(source: C++ Core Guidelines)
C++ may or may not be easier to learn initially, depends on how you learn and what approaches to code you prefer
C is more of a "do it yourself" language
and C++ gives a lot of features
C is smaller and simpler to learn "in full", but using C++ to get something to work is often eaier
I don't know how that specific tutorial is structured and what its contents are
there are many, many different ways to teach and learn C++
it will get harder later on for sure
after basics (pointers, primitives, simple functions), the things that are left to learn in C++ are quite complicated, compared to how those same things are in different languages
templates hopefully will be easy-ish to understands
templates have a somewhat unfortunate history
they were intended to just be a way to express genericity
with the idea just being:
for example,
you can have a list of ints,
you can have a list of strings,
you can have a list of bools,
why not just represent all those as a single type that is copied for each item type T?
now you can have a list of Ts
depends on a specific programmer
one very, very simplified way to view the reason for doing this is just "this takes less time to write"
@tawdry jungle you probably shouldn't concern yourself too much with all this, just learn at your own pace, use different resources and experiment
all that I'm writing here is just some random trivia that you can come back to later on
(I'm away making cursed tea)
maybe
too much citrus for a milk tea
+some honey
the weirdest I made was probably hibiscus tea mixed with banana-flavoured soy milk
it tasted good but
I need to find what it looked like
it appears yellowish only because of light
(it's actually just complete grey)
@whole bear ๐
how are you doing
!d list
class list([iterable])```
Lists may be constructed in several ways:
โข Using a pair of square brackets to denote the empty list: `[]`
โข Using square brackets, separating items with commas: `[a]`, `[a, b, c]`
โข Using a list comprehension: `[x for x in iterable]`
โข Using the type constructor: `list()` or `list(iterable)`...
!e print(dir(list))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
:white_check_mark: Your 3.12 eval job has completed with return code 0.
<class 'reversed'>
yes
items[:-1]
[)
def list_reverse():
items = list(input("Give a list you want reversed "))
rev = []
for i in items:
rev.append(-i)
items.remove(-i)
return items
!if-name-main
This is a statement that is only true if the module (your source code) it appears in is being run directly, as opposed to being imported into another module. When you run your module, the __name__ special variable is automatically set to the string '__main__'. Conversely, when you import that same module into a different one, and run that, __name__ is instead set to the filename of your module minus the .py extension.
Example
# foo.py
print('spam')
if __name__ == '__main__':
print('eggs')
If you run the above module foo.py directly, both 'spam'and 'eggs' will be printed. Now consider this next example:
# bar.py
import foo
If you run this module named bar.py, it will execute the code in foo.py. First it will print 'spam', and then the if statement will fail, because __name__ will now be the string 'foo'.
Why would I do this?
- Your module is a library, but also has a special case where it can be run directly
- Your module is a library and you want to safeguard it against people running it directly (like what
pipdoes) - Your module is the main program, but has unit tests and the testing framework works by importing your module, and you want to avoid having your main code run during the test
def function(parameter):
pass
function('argument')```
map(int, input().split())
def func([1, 2, 3, 4, 5])
!e py print('abc def ghi'.split())
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['abc', 'def', 'ghi']
!d str.split
str.split(sep=None, maxsplit=-1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).
If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters as a single delimiter (to split with multiple delimiters, use [`re.split()`](https://docs.python.org/3/library/re.html#re.split)). Splitting an empty string with a specified separator returns `['']`.
For example:
this only for stdin
program user input
not function user input
!e
def print_all(items: list[int]):
for item in items:
print(item)
print_all([3, 2, True, False])
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 3
002 | 2
003 | True
004 | False
class slice(stop)``````py
class slice(start, stop, step=None)```
Return a [slice](https://docs.python.org/3/glossary.html#term-slice) object representing the set of indices specified by `range(start, stop, step)`. The *start* and *step* arguments default to `None`.
st_reverse
rev.append(-i)
TypeError: bad operand type for unary -: 'str'
!e -''
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | -''
004 | TypeError: bad operand type for unary -: 'str'
(that'd just be per-item negation)
def list_reverse(lst):
return lst[::-1]
@wanton estuary ๐
class list([iterable])```
Lists may be constructed in several ways:
โข Using a pair of square brackets to denote the empty list: `[]`
โข Using square brackets, separating items with commas: `[a]`, `[a, b, c]`
โข Using a list comprehension: `[x for x in iterable]`
โข Using the type constructor: `list()` or `list(iterable)`...
!d collections.abc.MutableSequence
class collections.abc.Sequence``````py
class collections.abc.MutableSequence``````py
class collections.abc.ByteString```
ABCs for read\-only and mutable [sequences](https://docs.python.org/3/glossary.html#term-sequence).
Implementation note: Some of the mixin methods, such as [`__iter__()`](https://docs.python.org/3/library/stdtypes.html#container.__iter__), [`__reversed__()`](https://docs.python.org/3/reference/datamodel.html#object.__reversed__) and `index()`, make repeated calls to the underlying [`__getitem__()`](https://docs.python.org/3/reference/datamodel.html#object.__getitem__) method. Consequently, if [`__getitem__()`](https://docs.python.org/3/reference/datamodel.html#object.__getitem__) is implemented with constant access speed, the mixin methods will have linear performance; however, if the underlying method is linear (as it would be with a linked list), the mixins will have quadratic performance and will likely need to be overridden.
Changed in version 3\.5: The index() method added support for *stop* and *start* arguments.
@chilly thorn ๐
๐
Accept a list, create a new, empty list, iterate over the input list, insert into the new list, return the new list.
def func(lst):
rev = []
for i in lst:
rev.insert(lst[-i])
return rev
!e
help(list.insert)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Help on method_descriptor:
002 |
003 | insert(self, index, object, /) unbound builtins.list method
004 | Insert object before index.
never for i in lst
o
so then item? or?
@somber heath
!e
def func(lst):
rev = []
for i in lst:
rev.insert(lst[-i])
return rev
print(func(["1", "2", "3"]))
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 7, in <module>
003 | print(func(["1", "2", "3"]))
004 | ^^^^^^^^^^^^^^^^^^^^^
005 | File "/home/main.py", line 4, in func
006 | rev.insert(lst[-i])
007 | ^^
008 | TypeError: bad operand type for unary -: 'str'
(and don't do that yet either)
no
it won't work
morning @somber heath
@soft axle
you're using items as indices
it did not work
@soft axle what data are you testing on?
you're just being lucky with your inputs
huh
test on 100, 200, 300
let me chekc
(I'm not running that again because I've literally ran on a different input before and it did not work)
!e ```py
def rev_list(lst):
rev = []
for i in lst:
rev.insert(0, i)
return rev
print(rev_list('abc'))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['c', 'b', 'a']
!e
# what list.insert does
a = ["0", "1", "3", "4", "5", "6", "7"]
a.insert(2, "2")
print(a)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['0', '1', '2', '3', '4', '5', '6', '7']
only AI watermarks work
the only reliable detection
I once applied for a role on some server using AI text, but it was as a joke and quite openly
"detection" that says "definitely AI" instead of "not sure it's human" should be banned
in case of text
for images, there are reasonable cases to conclude definitively
you can't fake cursed AI art well manually given enough detail
with all the artifacts
but you can trivially fake AI-gened text without using AI
if you can fake it easily, you can accidentally "fake" it too
after all LLMs are literally are "how like is it to be written by human?" machines
which makes the AI text "detection" fundamentally impossible
you can only use it to compare models
brb
https://github.com/HimrajDas/SQTHON
I have made the readme.md, so now you can see what is this reallly. You don't have to read my mind.
@steel delta hey can i work with the sqthonAI with you?
10000%
well im interested in working with the project can you dm me
never built this kind of library
but im good at python
I have sent you msg.
you need to be familier with sqlalchemy btw to work on this package.
HIII
Support Wintergatan:
- Patreon โบ https://patreon.com/Wintergatan
- Youtube membership โบ https://bit.ly/4cQVM7C
Marble Machine Engineering Discord Server:
https://discord.com/invite/7aSFJA6bkH
Video edited By Martin and Hannes from the Trainerds YouTube Channel:
https://www.youtube.com/c/TRAINERDS
โ
PATREON โบ https://patreon.com/Wintergatan
YO...
Heyy
@Manasa ๐
fellow wintergatan watcher ๐
yep it is awesome ๐
yes?
@plush ether how is it going? what is your weekend? ๐
how are you
Indians everywher
is harry at home? ๐
good and what about you?,
Fine and you??
@Manasa i am fine, thx for asking.
Hiii
@odd dove I find it helpful to remember Patanjali yoga sutra 1.33
yeah but thats not 100% correct actually
try to read ancient books to learn more about it
what is better a student with foreign key group id or group that has the list of students
what do you thonk of cloud computong
im thinking to follow up in that field
!e
import random
def pick(one):
return one[random.randint(0, len(one))]
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
import random
def pick(one):
return one[random.randint(0, len(one))]
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
hwid
pls help me
Hey how do i learn competitive programming in python
is this still a good field to learn?
whats up?
yep
๐ ๐๐ผ
hi
@upper basin time to invent a new marketing term: Quantum ORM
whats that?
examples of ORMs:
https://www.sqlalchemy.org/
https://ponyorm.org/
technically what I was referring to is a query builder rather than an ORM
but `ORM' is more popular as a term
abstraction on top multiple database languages
well i know bout that but i thought of a marketing strategy
i wanted to know what do you mean by quantum ORM?
(it was a joke based only on this, not an actual serious suggestion)
the context was that the thing on stream is, in part, an abstraction on top of multiple different packages for quantum
i dont have that much knowledge on this but the scientist max plank lost all of his hair just by discovering quantum mechanics
@obsidian dragon What software do you use for the avatar in your stream? I know veadiotube for PNGtubers, but the motion detecting 3D ones are cool
Yep.
Thanks, Could you put the name down here. I'll check it out
what project youre working with?
A boring package for quantum circuits.
whats the purpose of the package?
To create a universal tool for creating and compiling quantum circuits.
Most people have to use one package or another, where the two may have slightly or drastically different syntax, so with my package that's eliminated. Additionally, I do the main synthesis and such on my side, so the performance between different packages is much less (essentially, the performance across different frameworks I integrated/wrapped become more consistent).
VseeFace
use VRM
Thank you @obsidian dragon
Has anyone used veadotube on Ubuntu? I just cannot get it to run
evaluate the expression
it must resolve to a boolean
and that's kind of all
@fossil dirge == and other operators are not inherent to if
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
do you have arithmetic implemented yet?
== is just like arithmetic, but outputs a boolean value
same for <, and and others
they aren't related to if
these are two separate concepts
condition is just an expression, the value of which is either truthy or falsy
evaluate the condition
evaluates to true => go into if body
evaluates to false => go into else body
evaluates to something else => type error
condition = (a == b)
if condition:
...
no like if (a == b) { }
there is no reason to make == an inherent part of if
in case of C#, they do have special handling for ifs
but
it's only for things like is, which bind variables
look i jsut want to have c if conditions
then just evaluate expressions within the condition
that the thing
idk how to do dat
ye
Being under the weather has a simple solution. Helium balloons. UP.
hmm
bouta buy it off of darkweb.com
how C handles it:
1 + 2 is 3
1 == 2 is 0
1 + 1 is 2
1 == 1 is 1
k...
It might not cure you, but you're liable to not care about it so much.
C considers the condition true when it evaluates to anything other than 0
actually im a litle buisy rn
i gtg now
if u awnna help just throw me a dm to open a dm
ill respond when available
cya
What are the requirements for me to have chat permission?
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@upper basin you need something generic to do "set to False, do something, set back to True"?
can you show the code again?
yes
it should be a context manager, but probably not the way the copilot suggests it
with self.without_logs():
...
or suppress logs
(whatever name is better)
@upper basin with finally
also add checks to make sure it's actually changing
right now, nesting results in an invalid state
with self.suppress_logs():
with self.suppress_logs():
...
# issue here
within a block but logs
@upper basin it's unrelated
no
finally is there to make sure exceptions don't invalidate the state
with self.suppress_logs():
with self.suppress_logs(): # this should raise an error
...
when already False, raise
same inside when setting it back to True
@upper basin it's a RuntimeError not a ValueError
!d contextvars
This module provides APIs to manage, store, and access context-local state. The ContextVar class is used to declare and work with Context Variables. The copy_context() function and the Context class should be used to manage the current context in asynchronous frameworks.
Context managers that have state should use Context Variables instead of threading.local() to prevent their state from bleeding to other code unexpectedly, when used in concurrent code.
See also PEP 567 for additional details.
Added in version 3.7.
nesting can be enabled through counting or context variables
(and some other approaches)
though this one is not entirely applicable here
I might be confusing it with something else
yeah, contextvars is likely too heavy for this
@obsidian dragon what is the vscode plugin you are using for sql
@obsidian dragon working directory
@upper basin home
the button
@obsidian dragon
cd there?
you also need to venv
cd /d "%~dp0"
"%~dp0venv\Scripts\python.exe" "%~dp0app.py"
@vocal basin how to select a cell in the database?
<td>{{ order[[0,2]] }}</td>
does order[0][2] work?
no
@somber heath prototype-oriented
JS is too
or with first two letters of scala
(if we're just looking for -oop prefix acronyms that make a word)
Scala I'd expect to just have Java's OOP
non-prototype
I'll stream after I eat dinner.
Have to see if I broke anything with this new labelling for circuit log.
each program is a quine
codeout
It originally referred to a fictitious instruction in IBM System/360 computers (introduced in 1964)
The Z1 (1938) and Z3 (1941) computers built by Konrad Zuse contained illegal sequences of instructions which damaged the hardware if executed by accident.
amazing
The HCF instruction was originally a fictitious assembly language instruction, said to be under development at IBM for use in their System/360 computers, along with many other amusing three-letter acronyms like XPR (Execute Programmer) and CAI (Corrupt Accounting Information), and similar to other joke mnemonics such as "SDI" for "Self Destruct Immediately"
AF, how can I avoid this: Thread 'MainThread': missing ScriptRunContext! This warning can be ignored when running in bare mode.
in which context is it happening?
some random discussion
https://discuss.streamlit.io/t/warning-for-missing-scriptruncontext/83893/6
Alright I think Iโve got my case figured out at least. This is what worked for me: from streamlit.runtime.scriptrunner import add_script_run_ctx,get_script_run_ctx from subprocess import Popen ctx = get_script_run_ctx() ##Some code## process = Popen(['python','my_script.py']) add_script_run_ctx(process,ctx) My interpretation of the error is t...
docs don't even include streamlit.runtime
and very painful to navigate in general
well, at least, search seems to work
is there a specific line that causes it?
this might be a bug in streamlit
Hello, people!
hello
What is the more impressionant Python software to you guys?
hi all
shalom
@rugged root
@split flower ๐
hy
We finished our EOT exams we r closin school on friday
End of term?
yep
Nice
Bro our time table changed like 3 times this term, so annoying...
That's so irritating
How close to the exams did they do it?
ikr
Like day before?
How do cats balance themselves while eating with two hands?
like every 2 weeks
and every CAT 1 exam our ict teacher never counts the marks properly ;-;
@timid marten what is the origin of your name? โฎ๏ธ
I was the king of highschool ahh story
I thought she was about to say we don't have to pay for anything because we're european.
Took me a second to realize you didn't mean like a medical CAT exam or scan
If you put it on your pinky you're a villain.
๐ญ
Thumb and Index, you're middle-eastern. Middle finger you're green lantern. Ring you're married. Pinky you're villain. I'll go with green lantern.
"A title or form of address given to scholars, especially those teaching in a medieval university."
Sorry folks, the room cieling fan makes some noise. ANd I am just too old to be able to mute instantly when I join
Ig his logic is messed up
sentence = input('Enter a sentence: ')
index = 0
uppercase_count = 0
lowercase_count = 0
while index < len(sentence):
if sentence[index].isupper():
uppercase_count = uppercase_count + 1
sentence[index].islower()
lowercase_count = lowercase_count + 1
index = index + 1
print('That string has', uppercase_count, 'uppercase letters')
print('That string has', lowercase_count, 'lowercase letters')
Do " py with your code :D
Even with the While loop
Your .islower() condition should be separate
sentence = input('Enter a sentence: ')
index = 0
uppercase_count = 0
lowercase_count = 0
while index < len(sentence):
if sentence[index].isupper():
uppercase_count = uppercase_count + 1
elif sentence[index].islower():
lowercase_count = lowercase_count + 1
index = index + 1
print('That string has', uppercase_count, 'uppercase letters')
print('That string has', lowercase_count, 'lowercase letters')
This shall work well
Magiste is an oldddd epithet for Zeus, the Great/Mega one
If you're in the code help channel, please use the #code-help-voice-text channel
Sob
Glad it work @cerulean minnow
I told you its logical error
God of Lightning and Destiny, he would've loved programming
thank you jigar
It was one of many nicknames I received during those years XD
@cerulean minnow Could you add logic for a special character?
So it can count the number of special characters used in the sentence.
@upper basin What do I need to do to get Screen sharing rights? Is there a process?
Yes, you need to ask a moderator or admin to give you temporary permission.
@rugged root
Gotcha!
If you have sth to stream right now, you can try asking Mr. Hemlock.
No I don't. I just noticed that I wouldn't be able to share my screen, like you were, if I wanted to convey something to someone
Yes. It's to moderate what is streamed on the server, i.e., inappropriate images.
Similar to the voice verification which is to prevent voice trolls.
Yes, that's important too
good example of douchiness
https://github.com/asottile/pyupgrade/issues/801
Yes, but this has always been a delicate balance.
He was too confrontational and a douche.
But any kind of #wontfix answer would have pissed some or the other, no?
brb, eating dinner
I prefer blunt responses
"no thanks" is going a bit far
There's advantage in tact.
Too many people see โI donโt think this a good ideaโ as โif you argue with me more, Iโll change my mind. โ
Then maybe that person shouldn't be debating/arguing to begin with.
Maintainer was clear, "No Thanks"
Not trying to argue, but to genuinely understand how to do this tact fully, what is a general tactful answer?
"I will not be implementing this because I worry about having a ton of options that requires heavy maintenance."
"Sorry folks, we do not want to add option flags so we will not be taking this up"
how about
I understand where you're coming from, but I don't think this is a good idea because x, y, z. Feel free to fork the repo if you'd like to change it for yourself.
Which is tactless. You can explain why the answer is no, and present an attempt for evaluating the proposal.
Yea, this is why I get in trouble all the time.
OK, but the person who was like "No... whaaaa..." could easily be offended by this too
I'm more Finnish then Dutch. Fluffy language is for worthless people without work to do.
well, that's fine, because I don't have to use your products. Unfortunately, I do have to use his.
though we are transitioning away from that over his pointless refusal to support pyproject.toml
Giving a polite and actually relevant response instead of "No thanks.".
Wow, I like this guy, I want to hire him. ๐
pyproject.toml will be supported when pip freeze does would be my answer
excellent plan
if everyone with that approach worked at one place we could just avoid them so as not to have to deal with that support
I'd love it
Wasn't open source a little in your face about this opinion too - Its Code & Community, if any of the two are not upto your standards, you can always fork.
I understand this is easier said than done. But that was always the point wasn't it?
Given this information, does he owe the user any amount of "tact"?
Again, I am not encouraging that behaviour, but trying to understand if he is obliged.
Tact is basic mannerism. It's not owed, it's expected.
of course, he doesn't
but then he shouldn't be surprised that people move away from his products
It's like saying did you owe that guy to say "Hello". It's just common manners.
it's how it works
Agreed.
be nasty to your userbase and your userbase vanishes
Is his job his library?
Until your userbase needs the codebase as badly, that's when they run a mutiny - or a fork ๐
pre-commit is on tidelift
gaddafi before he went to seed
vs gaddafi after he went to seed
quite the downfall
most other dictators weren't good-looking to start with
such as the Angry Moustache Man
Oh come on, he was not that Angry!
< I am joking, please, just joking />
What do you mean by "going to seed"
Yeah I forgot what that term meant
@rugged root Can you watch sth real quick?
I can't currently. I'm having to look through hundreds of our clients to see if they have an engagement letter in our document management system
All good.
44 34 33 23 13 03 02 01 00
44 43 42 32 31 30 20 10 00
44 34 33 32 31 21 11 01 00
24 14 04 03 02 01 00
11 01 00
@peak depot Can you make a list? :D
make a set instead; i need to use & to see if we share similar don'ts
It's looong
can you though
Dewit-
good night people
nighty noo
24 : 8 : 24 : 8 : 24 : 8 : 24 : 8
@whole bear Yo
hi!
d*pi
5.5*pi = 17.28
*114 for rotations per second
/100 for meters per second
*3.6 for km/h
71km/h
@gentle flint
why are guys mean? o.o
nah
programmers, idk i might be catching a wrong vibe here
is it a clasic case of a shot pp sindrome?
!rule 12
:x: Invalid rule indices: 12
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
input angular velocity is 4 rotations per second
output is 28.5 times input
output is 114 rotations per second
output wheel diameter is 5.5 cm
circumference is 5.5ฯ = 17.3 cm = 0.173 m
0.173*114 m/s
19.722 m/s
1 km/h = 1000/3600 m/s = 1/3.6 m/s
1 m/s = 3.6 km/h
19.722 m/s = 71 km/h
If a radio operator gets punched, does it Hz?
28.5 + 24/8
hz = s^-1
Could someone help? I cannot be in VC but i need help understanding what I am to do, it says no value is set for the code and I'm not sure what I have done incorrectly
Can you share the code?
T = period time (mesured in seconds)
def convert_kg(value):
"""Converts kg to lb and oz"""
#1kilogram = 35.247 ounces
#1kilogram = 2.20462 pounds
pounds = value * 2.20462
ounces = value * 35.247
def convert_pounds(value):
#1pound = 0.453592 kilograms
#1pound = 16 ounces
kg = value * 0.453592
ounces = value * 16
def convert_ounces(value):
#1ounce = 0.0283 kilograms
#1ounce = 0.0625 pounds
kg = value * 0.0283
ounce = value * 0.0625
if name == "main":
# Test your code here
convert_kg(10)
convert_pounds(10)
convert_ounces(10)
I've been at it for hours but I'm not sure if I should add the correct formulas like in math, since it gives the converted numbers in the lab already
frequency = amount of periods per second
Can you give the error code as well?
yes
Does it tell you a particular line?
meow meow meow
this is the last time i will show the error
as in the image is the last attempt
!traceback
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
~~~~^~~
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
Can you give me that? Like what it gives you there
Over 90% sold out! Save 25% on remaining inventory with code 25OFF: http://www.CuriosityBox.com
cool isnt it?
yes its just loading rn
Ah gotcha gotcha, sorry
def convert_kg(value):
"""Converts kg to lb and oz"""
#1kilogram = 35.247 ounces
#1kilogram = 2.20462 pounds
pounds = value * 2.20462
ounces = value * 35.247
def convert_pounds(value):
#1pound = 0.453592 kilograms
#1pound = 16 ounces
kg = value * 0.453592
ounces = value * 16
def convert_ounces(value):
#1ounce = 35.274 kilograms
#1ounce = 0.453592 pounds
kg = value * 35.274
pounds = value * 16
if name == "main":
# Test your code here
convert_kg(10)
convert_pounds(10)
convert_ounces(10)
print(value, " kg converted is ", ounces , " ounces and ", pounds ,"pounds" )
So wait, is THIS the current code or is the code in the screenshot the current one
Because there're some differences
the one i copy pasted is current sorry i pulled up an old one by mistake
All good.
So the problem here is the scope. When you call a function, once it finishes, everything within the function disappears
Write code for the convert_pounds(value) function that converts value into kg and ounces. The function should output the following statement โx pounds converted is y kg and z ounces.โ. (So this Im assuming i need to put print statements between each conversion group)
Like in convert_kg(), pounds and ounces aren't available after that. If you want to use a value from those functions, you need to return them, like how you have it in the screenshot
However, even in those cases, all you're doing is feeding those values to print(), so they disappear after that
ohh ok so the return statement is correct
Yep
ok
You'd need to assign them to a variable if you wanted to use them later in the code, though
So like pounds, ounces = convert_kg(45) or something
Ohh ok so I would probably have to put that to the top lines
I think someone invited me here from some other place
like before everything else
@warm garnet I try not to make exceptions when it comes to the voice gate
You'll need to get the role like everybody else
no problem
but it was related to other stuff not just programmin
Not quite. You can't call the functions until Python sees them.
they said it has cool ppl
Ahh ok ok
Remember, things are read top to bottom in Python (and most other programming languages)
anyone here into web dev ?
i have a web app (CRM System) i want to turn it into a saas
cool ppl, as if learning motivated, not people who just flex skills they dont have
ok I'm gonna do some adjusments to see what I get ๐
something like when a user buys a subscription he gets his own database
If you get stuck, don't hesitate to ask
That's pretty slick
well, I'm a bit of bser, because i dont learn anything, I have motivation problems, but I dont claim to know what i dont know, and still try to engage in related topics
ok I think i understand it similar to how i made a times table
i heard that i need to do it using dockers actually
i have a crm system
it's all about installation
programming communities tend to be people who like to rub it in your face if you do something wrong, like as if you didnt spend years learning it and now you treat me like im mentaly set back, just because I dont know it.
https://open.spotify.com/track/3v19cKJVDIstaTbo6nonuD?si=z9kiAS_OTb-FS6LCZVTdyA&context=spotify%3Aalbum%3A1LL5VZdY7CBXScXB0oQ4tB
the cory wong song
https://open.spotify.com/album/0H1yAZhstq5RgdS1fuHoe4?si=ZzCDGPjMQky31BfwO__wIw
the flute album
i made researches about if it's gonna be better to have sub domains for each client
cyber security communities are filled with people who try to act like they are the shit o.o
or have them all under the same domain
aM hAxOr
and have the Databases splitted using accounts
ubuntu is king bro
you aren't a real linux user unless you reverse engineered teams, rewrote it in apl, and compiled it from scratch on Kali
i don5t do much with programming now days, im trying to get a tutoring job, so im trying to remember the knoweledge in there, I like to do sometimes it stuff on free time, but that is rare
yeah
but i still having troubles using it
as a 4gb ram laptop
whenever i open gmail the laptop crashes lool
what did you say hemlock ?
I dont really get, having it difficult just because, I acept using something for learning purposes, but like other then that, in front of who are you flexing, actually give me reasons why is it more advantagious
o.o
that's pretty cool xD
I wrote this and I got this error: Traceback (most recent call last):
File "/workspaces/9780357421796_python-fundamentals-1e-6bacfd41-bf70-4ae4-9c39-d7d12180b0de/chapter1/mla01/student/main.py", line 1, in <module>
pounds, ounces = convert_kg(10)
^^^^^^^^^^
NameError: name 'convert_kg' is not defined
Yep, so remember what I said about it reading it from top to bottom
usually they have that much bus space to expand, but due to previous operating system limitations, this amount of ram was not usable, theorethicaly, it would just sit there unused even if you had it plugged in, so you might need new motherboard.
should i just have 8gb ram ?
idk what's my motherboard's limitations
I dont know
oh so what I believe i have to do is put the line of defining under each function for each of its conversions
yes you can just use the function after defining it not before
as far as I know from what im using, i rarely find something below 8 ram to run properly as minimum requirment
Setup of 40+ computers pre-installed with Windows 10 - that will have to be reimaged.
it's dell latitude e7450
everything is moving forward
wym
sorry pinnged wrong person D:
I think they meant to ping Ahmed, Conf
And apologies in advance, I'm lazy and give people nicknames
i just use these apps
https://www.dell.com/support/manuals/en-us/latitude-e7450-ultrabook/late7450om-v2/specifications?guid=guid-4b73a8aa-17e0-4fe7-88bd-01c1e0faa959&lang=en-us it should be written here if it has more ports for ram, do you think its limmiting you @warm garnet
?
onenote on ubuntu is a web version it sucks @drowsy apex
do you use it on virtual machine?
nope
guys i dont remember can u assign how much ram you need to use when instaling distro? =.=
hmm
in memory it says 2 6 or 8 ram, so probably they mean its up to people who sell, so it must be same mother board with ability to upgrade it to 8 ram
so 8 gb would be the max right ?
so what do you recommend to get another 4gb ram or just add 1 8gb
chat gpt says it can have up to 16gb
yeah
The Dell Latitude E7450 supports a maximum of 16GB of DDR3L (low voltage) RAM across two SO-DIMM slots. Each slot can accommodate up to 8GB, meaning you can install two 8GB RAM sticks to reach the maximum capacity.
@viral dove Yo
Hello
yes, if they are talking about the same model
idk sometimees it gets confusing with all the, max note and pro
@rugged root I understand it now a bit better but want to double check, the output has no errors just text
That'll work, yeah
in belive i would just have to add 10 to the statement
to make it clear how many Kg, lb, and oz are being converted
actually i always use linux instead of windows because of the performance and it ends up lagging lool
what do you guys actually do in coding ?
what are you into ?
I can actually show you a project I'm working on (still quite a ways off from being finished)
It's a wrapper for an API game: https://spacetraders.io/
A unique multiplayer game built on a free Web API. The best sandbox platform to learn a new skill or apply your knowledge in a fun and meaningful way. Use any programming language with our RESTful API to control the most powerful fleet in universe.
looks good
good luck with it
Thanks
facebook is old school @lethal shell
Eh, still relatively relevant
@jovial lichen Yo
correct, DMs are blocked

Hello, people
was it in Scala?
Yo AF
my favorite is still C# because my eyesight is weak so its the only way i can say i can see sharp
holy shit ๐
If Musk would be a programmer those are the languages he would develop
fuuuuu I'm going to have to call a client
I don't normally talk with clients
Not that I'm incapable of doing so, just not thrilled
The client was much nicer than I thought they would be
i need to go now cya guys 
It's like... you know when you have a bucket of sand and you flip it over and lift up the bucket
That's what it reminds me of
bye people
kowloon walled city?
we were talking about thailand, then taiwan, then hong kong etc.
o
Back in a sec, have to hit the little nerd's room
Scaffolding at a luxury hotel undergoing renovation in central Madrid collapsed on Tuesday, killing one construction worker and injuring at least 11 others, an official said.
Sup?
@rugged root wanted to know what you thought about taking these classes together
Wrong Hemlock ping
classic
we dont talk about it
uhh for my next semester
I have 2-3 python classes
and uh
SQL
and an SAS class
im not familiar with SAS or SQL at all
Define together
I can't afford to take classes
uh
I'm not a student
i was wondering if the topics are closely related or miles apart
They're closely related for sure
one of them is data mining and machine learning with python
one is web scraping, data analysis and visualization with python
then SQL i've never done before
and then a marketing analytics with big data class
Back in a tic
Python Prog Srty Alys Pen Test
Crisis averted
@somber heath ๐
It
Fucking
It ADDED the folders, just to remove them
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Who or how
@soft axle https://www.jetbrains.com/pycharm/editions/
Spyder is so underrated
I use it for variable explorer
d
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
!stream 344164464062496768
โ @soft axle can now stream until <t:1733189410:f>.
โ @soft axle can now stream until <t:1733191297:f>.
Hey everyone
Good! Been here for awhile but left and came back
Well we're happy to have ya back
back after good night sleep โจ
Nice and peaceful?
Hell yeah
@zealous pond ๐
โ @soft axle can now stream until <t:1733194374:f>.
What form would you have my help take?
Pitty
@fresh verge ๐
I hate this program
@somber heath ๐
Fucking.... Lacerte DMS
no python no AI ?
I suppose it's harder to get dataset to work on comparatively to make your own model.
It's hard to get a dataset and it's a pain to process unstructured data
This is just making me so much happier that I was a CIS major
I'm still angry with myself for not finishing and just getting a bachelors
But I was so burnt out and just destroyed
Easy?
How could you be sure it's easy when you haven't explored it yet?
Not just readability but efficiency as well
@whole bear Talk as much as you can sir
You meet the criteria
Just hit the button
I think it was a New York university
I have to grant the streaming perms
My ADHD is winning
!tvmute 920060007607844984 1d Constantly interrupting an on-going conversation after being asked not to is not acceptable behavior.
:incoming_envelope: :ok_hand: applied voice mute to @whole bear until <t:1733281946:f> (1 day).
It echoed what I'm assuming is your recording of our convo from earlier
Yeah it's just a voice mute
Because of the... interruptions
They will be verbally corrected, in the same way you were
And if it happens again, then the infraction hits
Swore? No
Interrupted?
Yes
And since it continued, it got a mute
take my good, soft & respectful advice.. (remember I'm not even involved):
"relax & cool off"
Come back later
late crowd tonight
its 9am for me ๐
import pandas as pd
def outcome(row):
if row['adderall'] + row['celsius'] > 5:
return "burnout"
elif row['capacity'] >= row['load']:
return "success"
else:
return "failure"
def get_input(prompt, limit=10):
while True:
try:
value = int(input(f"{prompt} (0-{limit}): "))
if 0 <= value <= limit:
return value
else:
print(f"Enter a number between 0 and {limit}.")
except ValueError:
print("Invalid input. Numbers only.")
def main():
print("Courseload Calculator")
adderall = get_input("Adderall?")
celsius = get_input("Celsius?")
discipline = get_input("Discipline?")
load = get_input("Courseload?")
data = {
'adderall': [adderall],
'celsius': [celsius],
'discipline': [discipline],
'load': [load]
}
df = pd.DataFrame(data)
df['capacity'] = df['discipline'] + df['adderall'] + df['celsius']
df['burnout'] = (df['adderall'] + df['celsius']) > 5
df['result'] = df.apply(outcome, axis=1)
print("\nHereโs the breakdown:")
print(df)
# Save to CSV
df.to_csv("data.csv", index=False)
print("\nYour data has been saved to data.csv. You can use it to train a model :)")
# Show the outcome
print(f"\nResult: {df.loc[0, 'result']}")
if df.loc[0, 'burnout']:
print("Too much reliance on stimulants. Balance is key.")
elif df.loc[0, 'result'] == "success":
print("You made it. Discipline wins!")
else:
print("You didnโt make it. Try a better strategy.")
if __name__ == "__main__":
main()
๐
its a bad joke. but the point is simple
there is no replacement for hard work.
good luck ๐
It's such gold
Greetings Opal.
It's good to see that your internet connection to ChatGPT is still working, Nett
Was worried for a bit
Your style of typing did not match what you pasted.
Exactly ๐
why isn't pg more used, why sql
I'd strongly advice against picking a fight with the admins of the server.
Alternatives like MySQL and SQLite are more popular.
Sorry, are you trying to use that as an insult, Nett? The two women holding hands emoji?
I feel maybe a temporary chat ban would be appropriate. Cause being arguing and insulting a staff?
We do have a message log
Dude, if you are a teenager.. don't be impulsive. You haven't understood the meaning of 'cool off' ..
Mmhmm
Opal, wanna hop down?
So very tired
It seems late
It is
Doing some database updates
Just wrapping up one last email
Dude now I have to bother looking at the message log
Exhausting
๐ง gotta ๐ง
I forgot monkeys don't wear underwear ._.
hi everyone
yes agncy123 u r really good in statistic
He is in marketing, of course he would be good at it
bye
hello
just some personal project
I am just trying out a few things.. teaching myself tailwindcss along the way as well
what all programming languages do you know?
python for backend, html/css/js for frontend
sheesh bro
is it more or less ๐
what about you? starting with programming?
Yeah, Im at the end of my first class for python
my final exam is wednesday
goodluck for exam
As for programming journey.. everyone start somewhere.. & like in the rabbit turtle story .. the slow BUT steady turtle wins the race
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
doing fine
have you read the instructions in #voice-verification?
No
What is it?
Hello ๐
You cannot spam your way to voice verification. If mods, such as Alisa, see you doing it they will give you a two week delay on voice perms.
To see these, check #voice-verification which contains the criteria for unmuting.
Is anyone here?
Yep!
Hello ๐ is it the of topic channel of the server?
Hello ๐
Hello what's up? Need help with something?
Nope not rn
Aight. Have fun :D
Thanks ๐
Hey are you a mod?
Noooo.
Oh ok I was just asking
There should be a list of them on the right of your screen if you're on pc.
The orange people :p
Thanks ๐
๐
Can you talk with me for a while
Coz I want to get voice verified
Uh sure? I'm chilling in vc right now haha
Ya I would have loved to join you there but I can't
I need to get verified first
Fair enough :p
Well, welcome to the python server :D
i see its hard to read
