A difficult homework with Python and I'm new -
The statement says:
While writing the use of instructions, a function, mentre (function name ), To calculate the following values:
-
The sum of the first n numbers is integers:
1 + 2 + 3 + ... + n
The sum of the first n odd numbers:
1 + 3 + 5 + .. + (2nĂ¢ ???? 1)
The sum of all the numbers that the user enters until it is 999 (the amount is not included in 999).
Before reaching a number 2 (with integer division) 1 can be.
I try with that time, but always responds to the error :(. Thank you very much for taking the time to respond and solve your problem.
x = input ("number:") x = int (x) y = 0 z = 0 while y & lt; x + 1: z = z + yy + = 1 print (z)
This is your first one. You can create from here. L
Comments
Post a Comment