Untitled

mail@pastecode.io avatar
unknown
plain_text
18 days ago
818 B
25
Indexable
Never
# 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
Leave a Comment