I have question about coding in Python, IDE I use is Pycharm Community Edition.
I have code like this
i = 0
str_1 = """public class Schedule_Boolean_Monday_""" + str(i) + """ {
public Schedule_Boolean_Monday_""" + str(i) + """_3(Context context){
this.mContext = context;
}
}"""
for i in range(3):
print(str_1)
And Current Output is like this
public class Schedule_Boolean_Monday_0 {
public Schedule_Boolean_Monday_0_3(Context context){
this.mContext = context;
}
}
public class Schedule_Boolean_Monday_0 {
public Schedule_Boolean_Monday_0_3(Context context){
this.mContext = context;
}
}
public class Schedule_Boolean_Monday_0 {
public Schedule_Boolean_Monday_0_3(Context context){
this.mContext = context;
}
}
public class Schedule_Boolean_Monday_0andpublic Schedule_Boolean_Monday_0_3(Context context)do not change. The str(i) in the String does not increment.I would like to get output like this
public class Schedule_Boolean_Monday_0 {
public Schedule_Boolean_Monday_0_3(Context context){
this.mContext = context;
}
}
public class Schedule_Boolean_Monday_1 {
public Schedule_Boolean_Monday_1_3(Context context){
this.mContext = context;
}
}
public class Schedule_Boolean_Monday_2 {
public Schedule_Boolean_Monday_2_3(Context context){
this.mContext = context;
}
}
Is this possible to increment Integer value inside of the String?? I would love to hear your advice.
Thank you very much