Question: ```
import math
i = (2)
max = (2048)
num = (2)
while i < max:
    print(int(i))
    i *= num
    if i > max:
        i /= num
        break
if i == max:
    while i <= max:
        print(int(i))
        i /= num
        if i == round(1):
            break
        else:
            print(int(i))
            i /= num
            if i == round(1):
                break

```

I am very new to the coding scene, so I thought a good language to start from is PYTHON3!
For some odd reason, I wanted the program to print out 2 and double it up to 2048. I then wanted to print out the numbers but divided them by 2! I got what I wanted in about 1-2 hours (I know... a complete pleb.)

Since I am very new, I just wanted to see in what ways this can be shortened/improved.

Answer: 
Please do not use something like `Environment.CurrentDirectory` in Azure Functions (or actually, just anywhere) to get a temp folder. Instead use the .NET-native method to do so:

```
Path.GetTempPath()

```

So ideally use something like this:

```
string pathTradeRecFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".xlsx");

```
My apologies, but I did not get your intention to save file in Azure storage file system? However if **azure function** allows to save file locally then you should use `Directory.GetCurrentDirectory();` which resolves to `D:\home\site\wwwroot` path.

Coming to my initial point, if you have a requirement to save the file locally to finally upload at persistent storage like `Azure Blob` then you don't need to save file locally at file system; you can use `MemoryStream` as shown in below code to upload the content at `Azure blob`

```
using (var ms = new MemoryStream())  
{ 
     using (StreamWriter writer = new StreamWriter(ms))
     { 
            writer.Write(obj);   // here obj represents the file data which you need to upload
            writer.Flush();  
            ms.Position = 0 
     };  
     await blob.UploadFromStreamAsync(ms);  
} 

```