print odd numbers from 1 to 100 in python using for loop. #shorts #youtubeshorts

preview_player
Показать описание
print odd numbers from 1 to 100 in python using for loop || print odd numbers in python using for loop || how to print odd numbers using for loop || how to print odd numbers using for loop.

@CodeWithShahrukh

#CodeWithShahrukh
#shorts
#shortsvideo
#shortsyoutube
#youtubeshorts
#python
#shortsyoutubevideo
#youtubevideo
Рекомендации по теме
Комментарии
Автор

for i in range(1, 101, 2):
print(i)

omji
Автор

import random

def guess_the_number():
secret_number = random.randint(1, 10)
attempts = 0

print("Welcome to Guess the Number!")

while True:
try:
guess = int(input("Guess the number between 1 and 10: "))
attempts += 1

if guess == secret_number:
print(f"Congratulations! You guessed the number in {attempts} attempts.")
break
elif guess < secret_number:
print("Too low. Try again.")
else:
print("Too high. Try again.")
except ValueError:
print("Please enter a valid number.")

if __name__ == "__main__":
guess_the_number()

Noob