Python Forum
converting from c# to python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: converting from c# to python (/thread-10892.html)



converting from c# to python - peper - Jun-12-2018

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];



RE: converting from c# to python - micseydel - Jun-12-2018

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.