اذهب إلى المحتوى

Hamza Nasr

الأعضاء
  • المساهمات

    3
  • تاريخ الانضمام

  • تاريخ آخر زيارة

كل منشورات العضو Hamza Nasr

  1. import random num = random.randint(1,10) guess = "" count = 0 limit = 3 out = False try: while guess != num and not out: if count < limit: guess = int(input("please enter your guess: ")) count += 1 if guess > num: print("the number is smaller") elif guess < num: print("the number is bigger") else: out = True except ValueError: print("please enter number only") if out: print("you lose") else: print("you win")
  2. text = input() word = input() def search(text, word): if word in text: print("Word found") else: print("Word not found") print(search(text, word))
×
×
  • أضف...