Coding Computing Coach Profile Banner
Coding Computing Coach Profile
Coding Computing Coach

@CodingComputing

Followers
7,887
Following
96
Media
314
Statuses
12,120

Making Python simple for you, by exploring the fundamentals. Posting tips, questions, explanations, solutions, and much more! Building @PythonResources

Maximize your coding skills 👇
Joined May 2019
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@CodingComputing
Coding Computing Coach
3 months
🚨 Python Testing Series 🚨 Employ testing to gamify your coding. Learn how to test code using pytest. Build a Cash Dispenser project in Test Driven style. Ongoing series of posts, see README at:
0
0
13
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why? a = [] b = [a.append(i) for i in range(5)] print(a) print(b)
27
39
217
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid If I had to mention just one: Writing code without clearly understanding the problem. A close second: Using copied code from StackOverflow/ChatGPT/whatever without having a clue about what it's doing.
4
10
170
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid Learning to use Version Control. Without version control, one is hesitant to make changes to the code, for the fear of breaking it. Version control gives you a safety net, and you can edit your code with the assurance that you can get back the version if something goes wrong.
5
8
161
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid Think and plan first, preferably with a paper and pen, and only after that open your code editor.
3
3
138
@CodingComputing
Coding Computing Coach
2 years
🚨 LIST METHODS CHEATSHEET Python list methods are incredibly useful. Here is a cheatsheet and reference doc for them. The document has explanations & details of 11 list methods. Peek at the cheat sheet in the attached image Grab the PDF cheatsheet and the full doc 🆓 by +
Tweet media one
5
18
124
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: A. Solution: TLDR ☑️ x.append(4) appends the value 4 at the end of the list x. ☑️ Hence, x, which was [1,2,3] before the append, now becomes [1,2,3,4] Details👇
2
1
111
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: C. Solution: x = 5 assigns the value 5 to x y = x > 3 This statement has 2 operators, `=`, and `>`. `>` is higher in precedence than `=`. So, the comparison x>3 is performed. x, ie, 5, is greater than 3, so the result is True. +
2
5
100
@CodingComputing
Coding Computing Coach
2 years
@rupali_codes Trying to put more thought into variable names. It helps a lot later. - No single letters (no x,y) - Nouns, not verbs (washed_spoon_list, not wash_spoon_list) - Descriptive (annual_interest_rate, not air) - Shortest possible, while satisfying the above
7
4
78
@CodingComputing
Coding Computing Coach
2 years
@KevinNaughtonJr Write tests because: 1. It is rare to write all the code correctly the first time 2. If you add a new feature, you should know if the old stuff still works 3. You can convince others of the correctness of your code
2
5
78
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer:A. Solution: [1,2], (1,2) are two values ( [1,2] and (1,2) ), separated by a comma. Such comma-separated values are interpreted as a tuple by Python. Hence, [1,2], (1,2) is exactly the same as the tuple ( [1,2], (1,2) ) Thus, they type of `a` is tuple.
3
5
75
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer: C. Solution: TLDR ☑️ The list on the right hand side gets "unpacked" into variables on the left hand side ☑️ First element, ie 1, goes to a ☑️ Last element, ie 5, goes to c ☑️ All that is left [2,3,4] goes as a list into b Details 👇
5
1
70
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid Jumping to code without thinking. It was in a course where I first learned to code. For exams, we had to scribble code on paper, in a rush. That's how I got into that habit: To quickly jump and code, without careful thinking. It took some time to break, but it was liberating.
2
2
67
@CodingComputing
Coding Computing Coach
2 years
🚨 LIST METHODS CHEATSHEET & REFERENCE 🆓 List methods are very commonly used. Never fumble with them again. Be more productive with a neat reference handy. Grab now ✅ PDF cheat sheet ✅ Notion reference document ✅ Updates and more Python tips here:
Tweet media one
5
13
58
@CodingComputing
Coding Computing Coach
2 years
@clcoding Nice! You can open an http server using python with just one command. python -m http.server will start an HTTP server in the current directory, which you can use to share files with other devices on the network!
2
8
59
@CodingComputing
Coding Computing Coach
2 years
@clcoding D. Explanation: The ^ operator is overloaded (different operation for different classes). For set operands (s1 and s2 are sets here), it returns the symmetric difference between the sets. See image for meaning. Hence {2,6,9} from s1 and {5,7} from s2 give the answer D.
Tweet media one
5
4
61
@CodingComputing
Coding Computing Coach
2 years
Python tip: Use `dir` to list the attributes and methods of an object. Useful for debugging and getting to know more about a class. Eg (code in image description)
Tweet media one
1
10
60
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer:B. Explanation: TLDR: s.replace('e', 'r', 1) returns a copy of s in which only the first 'e' is replaced by 'r'. Hence the output is 'awrsome', Option B. Detailed answer, read on: +
3
3
52
@CodingComputing
Coding Computing Coach
2 years
What would be the output of the following program, and why?
Tweet media one
12
9
54
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: A. Solution: TLDR int(2.0) gives an int, str(2) gives a string. Trying to add these two results in an error. Detailed explanation 👇
3
1
54
@CodingComputing
Coding Computing Coach
2 years
@_jaydeepkarale Automate the Boring Stuff with Python Excellent book that strengthens your Python knowledge, while helping you build your own useful projects!
3
3
51
@CodingComputing
Coding Computing Coach
1 year
@clcoding Answer:D. Solution: The function `my_func` works by calling itself, as we will shortly see. Let us analyze the code and see what is happening. my_func(5) x is not 0, so the if-condition fails, and the return value is 5 + my_func(4) Now, here is the tricky part... +
7
5
54
@CodingComputing
Coding Computing Coach
2 years
Python tip If you need both the quotient AND the remainder of a division, use `divmod` divmod(dividend, divisor) returns the tuple ( dividend // divisor, dividend % divisor) For example, to get the quotient and remainder of dividing 100 by 9, (Code in alt text)
Tweet media one
2
13
53
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer:A. Solution: To solve this question, we need to understand: 1⃣ What is a method, and what is `self`? 2⃣ What does __init__ do? Let's dive in! +
6
6
50
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: A. Solution: TLDR s.replace('e','i',2) replaces the first two occurrences of 'e' by 'i', in the string s. Therefore, 'developer' becomes 'diviloper'. Details 👇
1
1
53
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:D. Solution: TLDR ☑️x = 7,8,9 assigns tuple (7,8,9) to x ☑️x == 7,8,9 here == takes place before tuple formation. ☑️So x (which is the tuple (7,8,9) ) is compared to 7, that gives False. Then the tuple with 8 and 9 formed ☑️So the output is (False, 8, 9) Details 👇
4
4
53
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why?
Tweet media one
13
7
49
@CodingComputing
Coding Computing Coach
2 years
Python question (inspired from a tweet by @driscollis ) Given: a string, my_str, and a character, my_chr Task: Find the index of the SECOND occurrence of my_chr within my_str Eg: my_str = 'twitter' my_chr = 't' # Expected output: 3 Can you do this in one line of code? 🤔
8
10
49
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer:B. Solution: TLDR For non-negative integer arguments, `func` computes the factorial. func(4) returns 4 * func(3) func(3) returns 3 * func(2) func(2) returns 2 * func(1) func(1) returns 1 So, func(2) returns 2 So, func(3) returns 6 So, func(4) returns 24 Details 👇
2
5
49
@CodingComputing
Coding Computing Coach
1 year
@clcoding Answer:C. Solution: Recall that the `*` operator between a list and an int, produces the repetition of the list. Eg, [1,2,3] * 2 gives [1,2,3,1,2,3] Now, consider []*3 Here the list is empty, ie, it has no elements Therefore, 3 repetitions of 0 elements +
1
0
49
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: B. Explanation: The str.split method returns a list of substrings of the original string. The split method by default splits a string around whitespace. However, this behaviour can be changed by passing an argument to split. The argument `sep` specifies +
3
0
50
@CodingComputing
Coding Computing Coach
2 years
Python question, inspired from a question tweeted by @driscollis . What is the output of the following code:
Tweet media one
10
3
44
@CodingComputing
Coding Computing Coach
1 year
Can you identify the Python codes that can hang your computer? Give it a go, and do explain your reasoning:
Tweet media one
10
8
44
@CodingComputing
Coding Computing Coach
2 years
Python question. What does the following code output? Why? Is there something you might want to change?
Tweet media one
4
6
45
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:C. Solution: TLDR ☑️ The f-string will render `language`, ie, 'Python', as per the format specifier '*^30', this specifies ☑️ a width of 30 characters ☑️ ^ centered alignment ('Python' in the middle of a 30 character string) ☑️ * as the padding character Details👇
2
6
47
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why? A. [[1], [1]] B. [[1, 5], [1]] C. [[1], [1, 5]] D. [[1, 5], [1, 5]] (code in alt text)
Tweet media one
14
4
47
@CodingComputing
Coding Computing Coach
2 years
Well done, good attempt! I'll mention some impressive points and some suggestions for improvement because you asked. +
@Adebobby_tech
fa fa-code 2x
2 years
This is the Rock, Paper and Scissor. I did which has scoreboard through the implement of the global variable and it also have a loop function if you wish to continue the game. open for correction
Tweet media one
4
6
23
3
6
42
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid Fast typing is not essential, but it does help. As a developer, you will need to type all the time, be it code or documentation. All these processes will be smoother if you can your thoughts to text quickly.
0
2
44
@CodingComputing
Coding Computing Coach
2 years
Python question
Tweet media one
9
6
44
@CodingComputing
Coding Computing Coach
2 years
Python question: Break the math, v2 Here your task is to select a value for `x`, such that the code below prints: You got it! You may use at most one import from the standard library. Go for it, and explain how your solution works!
Tweet media one
6
7
42
@CodingComputing
Coding Computing Coach
2 years
Python tip Need to take a quick look at the operator precedence table? All you need to do is help('+') and you get a neat table as shown below:
Tweet media one
2
7
44
@CodingComputing
Coding Computing Coach
8 months
Python Question What is the output of the following code, and why? Do you know what is going to be printed when?
Tweet media one
14
3
43
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:C. Solution: TLDR ☑️ The list.append method modifies the list on which it operates, and returns None. Details 👇 To solve this question, we need to understand 2 things: 1⃣Methods on objects 2⃣list method `append` +
4
2
44
@CodingComputing
Coding Computing Coach
2 years
* Mini projects to do as you learn Python * With arithmetic operations and conditionals: - Income tax / electricity bill calculator - Area/circumference calculator for circle/rectangle - Simple interest calculator - Unit converter +
4
7
45
@CodingComputing
Coding Computing Coach
8 months
@clcoding Answer: 2 Solution: The concepts involved here are: 1⃣ Inheritance 2⃣ Method overriding 3⃣ __init__ special method Let's go! +
2
2
43
@CodingComputing
Coding Computing Coach
2 years
@_jaydeepkarale @codewithvoid This 👆 is great advice. An additional tip: If you CANNOT think of an honest name for the function, without using the word "and", then consider splitting the logic into multiple functions. Functions should ideally do only one thing, and the name should show what they do
2
6
42
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer: A. Solution: d = {'name':'Bob', 'age':30} creates a dictionary with keys 'name', 'age', with values 'Bob', and 30 respectively. Now let us consider what happens when len( set(d) ) is executed. +
3
3
42
@CodingComputing
Coding Computing Coach
2 years
Great to have 2002 buddies here! A big THANK YOU to every single one of you. I am working on making something special for you all, stay tuned!
3
1
43
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer:B. Solution: TLDR y = x binds x and y together. Changes made in y reflect in x. Hence, y[1] = 4 sets x[1] to 4 as well. Thus x becomes [1,4,3] Details 👇
3
1
43
@CodingComputing
Coding Computing Coach
2 years
Played around with PyScript, and got a simple Password Generator made! You can try it out here: Please be patient, PyScript is slow to load :( Hope to build more using this amazing tool by @pyscript_dev ! Screenshot:
Tweet media one
4
3
41
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why?
Tweet media one
10
2
43
@CodingComputing
Coding Computing Coach
2 years
🚨 Exciting news! I'm starting a weekly newsletter to share thoughts on Python programming. Take your coding skills to the next level, while keeping it simple and chill. Subscribe now, stay tuned to get a goodie that will be ready soon! Join here:
5
6
41
@CodingComputing
Coding Computing Coach
6 months
🎦 Function Definition vs Function Call 2-min video explanation. How do you like it?
6
9
41
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:A. Solution: For the purpose of arithmetic operations, Booleans are converted to integers. False is converted to 0. True is converted to 1. Therefore, True + True + False - True equals 1 + 1 + 0 - 1 ie 1. Hence, Option A is correct.
1
2
40
@CodingComputing
Coding Computing Coach
1 year
Python question Which of the following code snippets throws an error? Why? A. S1 only B. S2 only C. Both S1 and S2 D. Neither S1 nor S2 (code in alt text)
Tweet media one
15
6
42
@CodingComputing
Coding Computing Coach
1 year
What is the output of the following code and why? def myfun(x, y=2, z=5): print(x, y, z) myfun(0, 3)
11
6
42
@CodingComputing
Coding Computing Coach
9 months
Python Question What is the output of the following code and why?
Tweet media one
6
2
40
@CodingComputing
Coding Computing Coach
6 months
"Functions are first class objects in Python" What that means:
1
4
41
@CodingComputing
Coding Computing Coach
2 years
Explained in a picture: List Indexing in #Python
Tweet media one
6
8
37
@CodingComputing
Coding Computing Coach
6 months
Python tip If you need to install all the packages named in a file (conventionally named requirements.txt in Python projects), use pip install -r requirements.txt
2
4
39
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer: B. Solution: TLDR modify_dict doesn't mutate d, it returns a new dictionary. That returned dictionary is not assigned to anything. The d in the main namespace remains unchanged. Details👇
2
2
39
@CodingComputing
Coding Computing Coach
2 years
What is a feature of Python, that seems tiny, but makes coding much more convenient?
16
1
39
@CodingComputing
Coding Computing Coach
6 months
Python tip To list all the packages installed in your Python environment, use pip freeze It's also convenient to redirect this output to a file, like so pip freeze > requirements.txt
2
4
39
@CodingComputing
Coding Computing Coach
2 years
Python tip Get a sequence of key-value tuples from a dictionary using `items` method. Example (code in img description)
Tweet media one
0
3
39
@CodingComputing
Coding Computing Coach
2 years
@clcoding None of the above. The code results in an IndentationError. Python expects an indented block after the line with the 'while' keyword. However, there is no indentation hence the IndentationError. See thread for more about indentation in #Python
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: A, 🚨but better to call it IndentationError than SyntaxError. Explanation: After the line def sign(num):, The Python syntax expects an indented block (which is supposed to contain the body of the function). Indentation in Python can be +
1
0
13
2
2
38
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer:D. Solution: When s1 and s2 are sets, s1^s2 returns the *symmetric difference* of sets s1 and s2. (Check out the link in next tweet for a detailed explanation.) That is, elements that are either in s1 or s2, but not in both s1 and s2. +
2
3
37
@CodingComputing
Coding Computing Coach
1 year
Python One-line Challenge Given a nested list (ie a list-of-lists) of numbers, can you print the list which contains the largest number? See snippet for example and expected output (code in alt text)
Tweet media one
12
7
38
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why dct = {0:'zero', 1:'one', 2:'two'} lst = [i for i in dct] keys = dct.keys() print(lst == list(keys))
13
3
36
@CodingComputing
Coding Computing Coach
2 years
#Python #question What is the output of the following code, and why?
Tweet media one
10
10
34
@CodingComputing
Coding Computing Coach
2 years
#Python #question What is the output of the following code?
Tweet media one
11
8
36
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: B. Solution: TLDR y = x binds y and x to each other. So mutation to y causes mutation to x too. y[2] = 10 mutates x as well, making it [1,2,10,4,5] Details👇
2
4
34
@CodingComputing
Coding Computing Coach
6 months
Python Question Loops and comprehensions...
Tweet media one
9
2
36
@CodingComputing
Coding Computing Coach
11 months
Python question String methods, anyone?
Tweet media one
5
9
34
@CodingComputing
Coding Computing Coach
2 years
@mathsppblog Similar. I say something like, "return, but remember." A return causes to "forget" in the sense, the function starts afresh on subsequent calls. A yield causes to "remember" in the sense that the state of the generator is saved, and restored on the next item extraction.
1
1
37
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer: D. Solution: TLDR ☑️ (a:=6, 9) considers a:=6 as an expression, that assigns 6 to a ☑️ (a, b := 16, 19) considers b:=16 as an expression, that assigns 16 to b ☑️ So, at the time of printing a is 6 and b is 16 Details 👇
1
2
35
@CodingComputing
Coding Computing Coach
1 year
What is the output of the following code? x = y = 10 del x print(y)
12
2
34
@CodingComputing
Coding Computing Coach
2 years
@CodingMantras Answer: 32. Solution: int(x, base=8) converts `x` to `int`, interpreting it is a base-8 (octal) number. The value of "40", when interpreted as an octal number is 4*(8**1) + 0*(8**0) = 4*8 + 0 = 32 Hence, the value of int(x, base=8) is 32, and that is what gets printed.
5
2
35
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer: B. Solution: Two key point in clearly answering this question is: 1. Functions are objects in Python. 2. Function names are identifiers, exactly like variable names. How do these points lead to the solution? +
3
1
35
@CodingComputing
Coding Computing Coach
2 years
Are you confused with the OOP jargon? - method - self - __init__ This thread might help you:
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer:A. Solution: To solve this question, we need to understand: 1⃣ What is a method, and what is `self`? 2⃣ What does __init__ do? Let's dive in! +
6
6
50
1
3
34
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer: D. Explanation: The list.pop method removes an element from the list, and returns the removed element. When used without arguments, pop removes and returns the last element of the list. When an argument index is specified, +
1
1
34
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer:B. Solution: Here, li = ['W'] creates a list ['W'], and assigns it to `li`. Next, the `extend` method is called on `li`, with the argument 'XYZ'. What this does is, ☑️ iterate through the argument ☑️ append each item to the list li Let us make it more concrete, +
1
0
35
@CodingComputing
Coding Computing Coach
2 years
@clcoding Answer:B. Solution: The `sum` function takes 2 arguments 1 required argument, `seq`, which is iterable, and 1 optional argument, `start`, whose default value is 0. This function returns `start` plus the sum of all elements in `seq` In the question, +
3
1
34
@CodingComputing
Coding Computing Coach
5 months
@clcoding Answer: List Solution: A set can never contain a list. It may or may not be able to contain a tuple, but that depends on the content of the tuple. To understand the reason, let's understand how a set works under the hood. First of all, when you add an element to a set, +
2
2
35
@CodingComputing
Coding Computing Coach
9 months
@clcoding Answer: 3 9 Solution: The trick here is to understand `continue` in loops. As we know, by default, a while loop executes till the condition remains truthy. However, the `continue` adds a small twist to this. Let's explore that +
1
2
33
@CodingComputing
Coding Computing Coach
1 year
What is the output of the following code, and why? a = 'in' b = 'King' x = a in b y = list(a) in list(b) print(x, y)
8
5
33
@CodingComputing
Coding Computing Coach
2 years
Python question! Rack your brain, and break the math here. Choose a value for x, such that the output of the following snippet is False. Yes, you can do it. Go for it, and explain why your method works!
Tweet media one
11
0
33
@CodingComputing
Coding Computing Coach
7 months
@clcoding Answer: rows = 5 for count in range(1, rows*5+1): print( f"{('*' if count%2 else count//2):>3}", end='' if count%5 else '\n' ) (See image for output) ✅ Explanation: First we specify the number of rows. There are 5 rows in the question so 5 it is. +
Tweet media one
2
2
34
@CodingComputing
Coding Computing Coach
2 years
Python Question: Break the math, v3 Can you choose a value for `x`, such that the code below prints: You got it! Go for it!
Tweet media one
10
6
33
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:B. Solution: TLDR ☑️ By default, `min` is a function to calculate minimum. ☑️ min=0 assigns 0 to `min`, it is no longer a function ☑️ min(numbers) attempts to invoke `min` (integer 0), that results in a TypeError Details 👇
3
5
33
@CodingComputing
Coding Computing Coach
2 years
@codewithvoid Great advice! Trying to learn everything thins out your attention. Instead, focus on one language, and work on it's fundamentals. And, a complementary piece of advice: "Never stop learning"
0
2
33
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer: C. Solution: TLDR ☑️ (lambda a,b: a*b) is a function that takes 2 arguments and returns their multiplication ☑️ (5,4) are given as arguments to the function. 20 is the output of the function ☑️ (20 - True) is 19, because True is taken as 1 for arithmetic Details👇
4
2
33
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer:B. Solution: TLDR Num(5) + Num(10) actually returns 5-10, because of the way __add__ is defined. Details 👇
4
1
32
@CodingComputing
Coding Computing Coach
2 years
The `reduce` function in Python can simplify your code. Read the following to understand how 👇
4
4
33
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer: D. Solution: ☑️ 5 * True is 5 (True is taken as 1 in numeric contexts ☑️ 5*"Spam" repeats "Spam" 5 times ☑️ 5*[1,2] repeats [1,2] 5 times ☑️ 5*None is not defined, raises the error Details👇
3
2
33
@CodingComputing
Coding Computing Coach
1 year
Python Question Let's bring Walrus operator (:=) together with Logical Operators in this question. What does the code output, and why?
Tweet media one
8
1
31
@CodingComputing
Coding Computing Coach
2 years
Do you know a cool thing about Python ints? Python does not impose any restriction on the size of ints. So, you can create as big ints as your computer memory can fit. This allows you to work with HUGE integers!
4
4
33
@CodingComputing
Coding Computing Coach
1 year
Python Question What is the output of the following code, and why? (Code in alt text)
Tweet media one
7
3
32
@CodingComputing
Coding Computing Coach
2 years
@driscollis Answer:C. Solution: TLDR ☑️ f"{message:{fill}{align}{width}}" formats the message 'hi' with: ☑️Left alignment because of '<' ☑️Text width of 10 ☑️The remaining 8 characters to the right are filled with 's' ☑️That gives hissssssss (8 s characters) Details 👇
2
2
33
@CodingComputing
Coding Computing Coach
2 years
#python #pandas #tip Use `apply` method to apply a function to every element of a dataframe or series. Very handy for creating new df columns based on existing. See example image. (Code in image description)
Tweet media one
5
4
31
@CodingComputing
Coding Computing Coach
2 years
@RealBenjizo Answer: B. Solution: `t` is the tuple (1,5,10) inside the function `change_tuple`. t[2] is 10 t[1] is 5 so, (t[2], t[1]) is the tuple (10,5) t[:0] is added to (10,5) What is t[:0]? +
2
2
31