Simple and basic question on programming languages. Currently focusing on python and R.

Joined October 2021
Include

Only show posts containing:

Exclude

Hide posts containing:

Time range
-
Minimum likes
What will be the output of following code in #python? ```python a = {1, 2, 3} b = {1, 2, 3} print(*(a + b)) ```
33%{2, 4, 6}
33%[2, 4, 6]
33%Error
0%{1, 2, 3}
3 votes • Final results
1
1
2
327
Python Question A Day retweeted
The zip function in #Python is a built-in function that takes two or more iterable objects and returns an iterator that generates a series of tuples where each tuple contains one element from each of the input iterables.
1
1
2
1,076
What will be the output of following code in #python? ``` x = [1, 2, 3, 4, 5] a = *x, print(type(a)) ```
80%List
20%Tuple
0%ValueError: too many valu
0%Int
5 votes • Final results
1
1
258
Replying to @marcelotryle
github copilot? At least, there marketing pitch promises to write test cases automatically.
1
117
What will be the output of following code in python? #python #100DaysOfCode
1
3
254
Replying to @driscollis
if i had to take a guess, it would be option C
1
13
Java's son
JSON. What is it? A thread 🧵👇
131
Hi #python tutors, with chatGPT (and other LLMs in general), do you think people will be more interested in learning about programming languages (especially python) or less? @driscollis @PythonWithRune @mathsppblog @realpython @clcoding @RealBenjizo
1
4
3,531
I have been using it, and can definitely say, it lives up to it's name.
44
Replying to @driscollis
can't imagine using copilot without comments
1
42
Replying to @_jaydeepkarale
A lot less googling and jumping through stackoverfkow pages.
3
211
Also make an attempt to a think through, why a problem is a problem, (or what could be the cause). This will greatly improve your debugging skills, and more often than not you will be able to solve issues without debugging.
1
9
Replying to @driscollis
Don't directly jump to google as soon as you encounter the problem. Spend some time to solve the problem, if not programmatically, at least logically. Pen and paper are best for this.
1
1
240
Replying to @RussEby @driscollis
Yes, I see your point. Mostly I use this shortcut to handle None, but yeah you are right
2
52
I don't see the difference, can you explain with an example?
1
1
50
Replying to @driscollis
Using `or` instead of if/else for defining defaults
5
3
51
5,286