Untitled

mail@pastecode.io avatar
unknown
plain_text
5 days ago
1.1 kB
1
Indexable
Never
#homework solution 
student = 80
if student >50 :
    print('Success')
else :
    print('Unsuccess')    

#or 
student = 80
if student >80 :
    print('A')
    
elif student >70: 
    print('B')   
elif  student >50 :
    print('D')  
else :
    print('Unsuccess')    


# lists 
names = ['judy','ziad','aya','nour','somia','adam','rofida','zeyad']
print(names[1])

#print all list names
names = ['judy','ziad','aya','nour','somia','adam','rofida','zeyad']

for i in range(8):
    print(names[i])

#project code 
from mblock import event

questions = ['Hello','What is your name','How are you']
answers = ['hi','My name is pico','Iam fine, Thanks']

@event.greenflag
def on_greenflag():
    while True:
        answer = sprite.input('Say something')
        if sprite.answer in questions :
            print('found')
            j=0
            while not questions[j]==sprite.answer:
             j=j+1
            sprite.say(answers[j],2)

#Home work Create list that contains 6 Names and print only 3 Names using index 
Leave a Comment