Difference beetween C arrays and Python lists [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I ask this because i'm a beginner in CS and i have this doubt. So it would be nice if peeps try to explain instead of just make humor or downvote. I tought this site was for learning from others.
Is just a different name or there something different underlying it?
Can anyone briefly explain the difference beetween C arrays and Python lists?

A Python list is essentially an array of object references that keeps track of how many elements it contains.
(Conceptually, a Python reference is somewhat similar to a C pointer.)
Read more here: Internals of Python list, access and resizing runtimes

Related

Is there a way to compute the cosets of D<sub>2n</sub> in <i>S</i><sub><i>n</i></sub> [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Although this is a question of maths but I really wanted to figure out if something like this is possible or not by coding it .(preferably in C). I had the question posted in mathsstackexchange where I saw that there's a way to find out the cosets of D_12 in S_6 by using Python programming. Can someone just help me to figure out how are we doing this?
S_n is the group formed by all possible permutations of n-elements and D_2n is formed by the generators <r, s> where r =(123, n) and s=(1n)(2 n-1).
Here's the link to the answer
https://math.stackexchange.com/questions/3880306/find-the-cosets-of-d-2n-in-s-n
Also I am not accustomed to posting questions in stackoverflow, I really don't know how to add mathematical symbols.
Though the logic remains same, the implementation will vary from Python to c due to difference is data types and so on. So you should try learning Python, it’s very easy to learn and you can pick up writing code in Python within few days considering you already you know a few other languages. And writing such complex programs can be easy in Python due to the vast inbuilt libraries and readability. So it’s better if you learn Python and start implementing this in Python.

Trouble analysing spreadsheet using pandas python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Im trying to find a way to compare what students performed consistantly in their InternalAssessment_Performance to their FinalExam_Performance. Essentially i need to find what students have the same answer in both those columns.
How is it possible to compare the values in both commons and have them returned if they are the same?
Any help no matter how small would be great.
If the columns are aligned you can do something like this:
df[df['InternalAssessment_Performance'] == df['FinalExam_Performance']]

Abstract data types vs. data structures for Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
The way I understand it, you use data structures to implement abstract data types.
Am I correct in saying that you can implement stacks, queues, dictionaries, and tuples with lists? If so, does this mean that stacks, queues, dictionaries, and tuples are ADTs and lists are data structures?
Are strings also ADTs that are implemented by a list of chars?
And how are lists implemented in Python? In Java, you need to implement a List interface with LinkedList or ArrayList, etc. But in Python, it seems you can just straight up use a list like an int or an array in Java.

Convert number to corresponding words [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to develop a piece of code that converts a number to the corresponding words, e.g. 1 -> "One", 2 -> "Two"
Is there any function in Python to do this task?
The answer to this question is "no". There is no function in Python to do this task.
If you "have to develop code to do it" (your words), then using a builtin wouldn't really be a valid solution, perhaps?
If you have to develop code to do it, you need better specifications. Do you have to be able to just do 0..9, or any cardinal number, or any number at all? (floating point? decimal? negative?). Why do you have to develop this code? Is it homework, or some special purpose?
If you just have to do 0..9, then as mentioned in comments, you should use a dictionary. Take care of case of the input.
If you have to do anything more than that, looking at the implementation of num2word would certainly be educational.

Using plural names for variable lists (General Programming Style) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Due to programming extensively with Lists in Python, I have been naming many list variables, and iterative variables for iterating in the lists. Is it readable in general specific to Python) to use plurals for lists and singular forms for the iterative variable? Furthermore, do different coding conventions have different answers?
For instance:
room_states = []
for room_state in room_states:
...
I find it easier to understand, but it may give some trouble to other programmers who attempt to read my program, confusing one with the other.

Categories

Resources