Find Jobs
Hire Freelancers

CONVERT FROM c/c#/c+/c++ TO PYTHON CODE

$10-30 USD

Completed
Posted over 3 years ago

$10-30 USD

Paid on delivery
Hello. First of all, I have a zero base of C's code. Therefore I'd like to convert the code to python. (I don't even know which my code is, like C/C++/C#) Thank you. ============================================================================ typedef struct node { struct node* prev; char elem; struct node* next; }node; typedef struct _list { node* head; int position; node* tail; }list; void init(list* lptr) { node *ohead, *otail; ohead = (node*)malloc(sizeof(node)); otail = (node*)malloc(sizeof(node)); lptr->head = ohead; ohead->prev = NULL; ohead->next = otail; lptr->tail = otail; otail->next = NULL; otail->prev = ohead; lptr->position = 2; } void add(list* lptr) { int tposi; char nwel; int order; scanf("%d %c",&order,&nwel); getchar(); if ((lptr->position)-1 < order) { printf("invalid position\n"); return; } node *temp; temp = lptr->head; struct node *newnode; newnode = (struct node*)malloc(sizeof(struct node)); newnode->elem = nwel; for (int i = 0; i<order; i++)="" {="" temp="temp-">next; } newnode->next = temp; newnode->prev = temp->prev; temp->prev = newnode; temp = newnode->prev; temp->next = newnode; tposi = (lptr->position); tposi++; lptr->position = tposi; } void del(list* lptr) { int tposi; int order; scanf("%d",&order); getchar(); if ((lptr->position)-2 < order) { printf("invalid position\n"); return; } node *temp, *ptemp, *ntemp; temp = lptr->head; for (int i = 0; i<order; i++)="" {="" temp="temp-">next; } ptemp = temp->prev; ntemp = temp->next; ptemp->next = ntemp; ntemp->prev = ptemp; free(temp); tposi = (lptr->position); tposi--; lptr->position = tposi; } void get_entry(list* lptr) { node *temp; temp = lptr->head; int getnum; scanf("%d",&getnum); getchar(); if ((lptr->position)-2 < getnum) { printf("invalid position\n"); return; } for (int i = 0; i<getnum; i++)="" {="" temp="temp-">next; } printf("%c\n", temp->elem); } void printlist(list* lptr) { node *temp; temp = lptr->head; for (int i = 0; i<(lptr->position)-2; i++) { temp = temp->next; printf("%c", temp->elem); } printf("\n"); } int main(void) { int num; char command1; list* L; L = (list*)malloc(sizeof(list)); init(L); scanf("%d", &num); getchar(); for (int i = 0; i < num; i++) { scanf("%c", &command1); getchar(); if (command1 == 'A') { add(L); continue; } else if (command1 == 'D') { del(L); continue; } else if (command1 == 'G') { get_entry(L); continue; } else if (command1 == 'P') { printlist(L); continue; } } return 0; }
Project ID: 27481897

About the project

8 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello Thanks for your posting. I am a senior developer so i can do it very easily if you want.I’ve read your job description carefully and I am very interested in your project. I am sure that I can finish this project of 100% result in short time with the reasonable budget.
$19 USD in 1 day
4.2 (23 reviews)
4.5
4.5
User Avatar
Hi, my name is Daniel(but you can call me Lekrieg)This is a list implementation writen in C, I can convert it to python today or tomorrow if you want. Just give some time.
$15 USD in 2 days
5.0 (5 reviews)
3.6
3.6
8 freelancers are bidding on average $22 USD for this job
User Avatar
Hello, I've complete MS Software Engineering. I've 5-Year experience in software development and algorithm implementation. My Core Expertise in Java - C++ - C - C# - SQL - object-oriented - Data Structure - Swing - OpenGL - JavaFX. I have got your project requirement enough I'm excited with feeling that I would be able to satisfy your requirements Within Deadline. Please leave a message on my chat so we can discuss the project. Thank.
$20 USD in 1 day
4.7 (27 reviews)
4.7
4.7
User Avatar
Hello ! I have skills in both C and Python, and your code is C, I can convert it in no time !! Thanks for considering me !
$30 USD in 3 days
5.0 (7 reviews)
3.9
3.9
User Avatar
Dear, I know C/C++ and Python. Your code seems doubly linked list in C/C++. I can convert it to Python as Class. Please chat for more discussion. Thank You.
$30 USD in 2 days
5.0 (8 reviews)
3.2
3.2
User Avatar
give me the details, i will do it right away. having experience in many languages. let me know if interested.
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
greetings from the other side??, First of all I'm not one of those freelancers who'd write 45047 words on the proposal to impress you, I'm writing this to you that means I've genuinely read the details and the program, its pretty easy tho, and I'm up for completion for real, not just spamming around with bulk of texts, you can check out my profile for more details bout me. waiting for your text! regards, A Passionate Programmer.
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I am professional in this job I can assure you, that I give you too best class work you will like to comeback again and again
$20 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of KOREA, REPUBLIC OF
Seo-gu, Korea, Republic of
4.9
3
Payment method verified
Member since Sep 23, 2020

Client Verification

Other jobs from this client

Writing paper reviews
$10-30 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.