0
Could make 'current_month' (an int) be equal to a specific index of my array 'month'?
Like current_month=1 == month[1] which would be Feb. I am trying to get used to scripting with python for the sake of Data Science for my webpage, and want to implement a "current month program" into one of the webpages.
7 Respostas
+ 1
So that month array holds name of months?
+ 1
Michele Rene Machado so you want to check,
1== "Feb" or 0=="Jan" ?,
If the array is month=["Jan", "Feb", " March"]
+ 1
Yes if it is possible!! I still don't understand how will you do something like that .
So i tried something , not sure if this is what you want.
-----------------------
month=["Jan","Feb","March"]
month=dict(enumerate(month))
c=month[1] if 1 in month else 0
print(c)
dict(enumerate(month)) creates a dictionary with month values index as its key.
0
Keep in mind I am a new learner and do struggle with this, but find it very fun.
0
Yes!
0
So there is no loop eligible to attach it to the index number, I gotta do it manually?
0
Not completely sure, still waking up, thank you for the help, I will test this either tonight or tomorrow.