i=1
sum_i4=0
while i>=1 and i**4<1000 and i<=10:
sum_i4+=i**4
i+=1
sum_i4979
\[\sum_{i\geq 1, i^4<1000}^{10}i^4\]
i=1
sum_i4=0
while i>=1 and i**4<1000 and i<=10:
sum_i4+=i**4
i+=1
sum_i4979
x=[1,2,3,4]
y=[5,6,7,8]z=list([i,j] for i in x for j in y)
z[[1, 5],
[1, 6],
[1, 7],
[1, 8],
[2, 5],
[2, 6],
[2, 7],
[2, 8],
[3, 5],
[3, 6],
[3, 7],
[3, 8],
[4, 5],
[4, 6],
[4, 7],
[4, 8]]
z=list([i,j] for i in x for j in y if i+j>=8)
z[[1, 7],
[1, 8],
[2, 6],
[2, 7],
[2, 8],
[3, 5],
[3, 6],
[3, 7],
[3, 8],
[4, 5],
[4, 6],
[4, 7],
[4, 8]]
def grading (score):
if type(score)!=int and type(score)!=float:
print("Score must be integer or float type.")
elif score>100 or score<0:
print("Score must be a number between 0 and 100!!")
elif score>90:
print("Grade is A !")
elif score>80:
print("Grade is B !")
elif score>70:
print("Grade is C !")
elif score>60:
print("Grade is D !")
else:
print("Grade is F !")grading(score=75)Grade is C !
grading(score=-5)Score must be a number between 0 and 100!!
def infoprint( name, age, gender):
print(name, 'is', age, 'years old', gender, '.')
infoprint (name='Kim', 30, 'male')def infoprint( name, age, gender):
print(name, 'is', age, 'years old', gender, '.')
infoprint ( 'Kim', gender='male' )fac = 1
def myfactorial(n):
for i in range(n):
fac *= i+1
return fac
myfactorial(n=5)