Untitled

 avatar
unknown
plain_text
9 months ago
818 B
30
Indexable
# Create for loop to print from 11 to 20 (last Homework)
for i in range(11,21):
     print(i)
#or 

i=11
while i<21:
    print(i)   
    i=i+1 



# if condition
x = 2
y = 1 

if x<y:
    print ("x less than y")
else:
    print ('x is not less than y')    


# if condition with elif 
x = 2
y = 1 

if x<y:
    print ("x less than y")
elif x>y:
    print ("x greater than y")
else:
    print ('x is equal to y')    




#Simple calculator Factorial 

i=sprite.input('what is the number ?')
fac= 1
for i in range(i,0,-1):
    fac=fac*i
sprite.say(fac)


street = 10 
if street<10:
    print('No car can move here')
else:
    print('Cars can move here')



# Homework 
create an if condition that checks if the students succeeded or not depending on degrees variable
Editor is loading...
Leave a Comment