Python Forum

Full Version: converting from c# to python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi im new into python so i need ask few things
how do i use declarations in python, for example , in C you can use
Quote:void str(FILE *fp, int x){
and how i declare variable in python, in c you can write
Quote:char sendline[MAXLINE];
You don't declare variables in Python. They're created dynamically when they're assigned for the first time. We don't use arrays in Python either, generally, we use lists and add things to them rather than allocate the space beforehand. You can create a list full of None if for some reason you must pre-allocate.