@elonmusk has been a huge visionary and pioneer of innovative ideas. From payments, electric cars, going to space; he touches it soars to the moon. #AI is changing the world, the one who gets there best will sure reap sweet... #SoftwareEngineering#code#programming
We are definitely living in different times. At this moment several elections happening simultaneously a new wave of freedom fighters in the youth are taking back their nation, by force by fire; #Kenya spearheading. Things definitely will have to change. #NaneNane. #Peace always.
@clcoding The answer is b; [1,4,3]. When we say my_list[1], we are using the index to access the values of the list. Python indexes start from 0, 1. so the the first element of the list ie `1` is on the 0th index, the 2nd element ie `2`, is on the 1st index. So my_list[1] changes 2 to 4.
@clcoding The output is 18.0.
the value of b has been edited by Type casting, where a variable is converted to another data type. First a is converted into an integer, and loses the decimal point, becomes 18. it is then converted to a float, 18.0.
@clcoding Assigning a value to the variable of a function argument when defining the function, just sets the assigned value as the default in case the variable doesnt receive any arguments when called. If it receives arguments, the default is overridden.
@clcoding if we called the function passing two arguments: <multiply(3, 5)> result would be 15; the default value of 2 that's assigned to y, will be over ridden by the value passed when calling the argument.
@clcoding The answer is 6. We have defined a function <multiply> that takes 2 parameters. We have set a default value for y, if the function receives only 1 parameter. so calling the function as <multiply(3)>, we result in x = 3, and y = 2(default value), giving us 6...
When you have been coding in #python for a while, then switch back to do some #C, you sometimes get to have the occasional #memory#leaks, one has to #free(mind) when not coding in python... can you spot the error? #pun intended #SoftwareDeveloper#100DaysOfCode
@eddiejaoude Grid is a beast when you need to create several rows and elements. However, for a single row, or a single box, flex can do just as good. Ultimately grid is bliss!
@cytotoxicfc14@RealBenjizo You almost got it. one the item is popped, the list now has items less the items popped. so after the 1st pop, 7 becomes the 3rd element and not 4. check out how on my comment. https://t.co/HqZntI8sIw
@RealBenjizo The answer is C ie 10. I shall explain by posting a code and the result of running the code, check my comment thread. Also note, when we use pop, the return value of pop is the popped element. Hence the variable num1 contains the popped value and not the full list.
@edgarcia53@RealBenjizo not the same list elements as the example given, but check this source images to understand how the elements are popped. https://t.co/HqZntI8sIw
@RealBenjizo The answer is C ie 10. I shall explain by posting a code and the result of running the code, check my comment thread. Also note, when we use pop, the return value of pop is the popped element. Hence the variable num1 contains the popped value and not the full list.
@Sylvester_jnr1@ClearPyCode@RealBenjizo when we use pop, the return value of pop is the popped element. Hence the variable num1 contains the popped value and not the full list. Check my comment on the breakdown: https://t.co/HqZntI8sIw
@RealBenjizo The answer is C ie 10. I shall explain by posting a code and the result of running the code, check my comment thread. Also note, when we use pop, the return value of pop is the popped element. Hence the variable num1 contains the popped value and not the full list.
@RealBenjizo since when counting we start from 1, and not zero, when we say the third element, its the 3 item in the list. However when we want to reference it in a method like pop, we pass the index position and not the item position.
hence index 2, is the 3rd element or 3rd item.
@RealBenjizo so when we pass an argument to the pop method, we are passing the index position. hence when we do `pop(2)` we are passing the 2nd index which points to the third element in the list.