#This is my first PYTHON program n=int();s=int();i=int();print('Please enter value for NIn');n= int(input());S=0;for i in range (1,n, 1): if i % 2== 0 : S=s+i; print("'nCurrent value i=",i," S=",s); print ("Final result suma is S=", s);
9
Please enter value for NIn ("'nCurrent value i=", 2, ' S=', 0) ("'nCurrent value i=", 4, ' S=', 0) ("'nCurrent value i=", 6, ' S=', 0) ("'nCurrent value i=", 8, ' S=', 0) ('Final result suma is S=', 0)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!