Problem Statement: Write a Python program that asks the user…
Problem Statement: Write a Python program that asks the user to enter a positive integer n. The program should then print all numbers from 1 to n that are divisible by 3 or 5, but not both. Validate the user input to make sure that number input is positive. Requirements: Use input() to get the value of n. Use a for loop to iterate from 1 to n. Use if statements to check divisibility. Use print() to display each valid number. Expected Output: Test Case 1: Enter a non-negative number and code will display all numbers which are divisible by 3 or 5 until that number:203569101218 Test Case 2: Enter a non-negative number and code will display all numbers which are divisible by 3 or 5 until that number:-20You have entered a negative number.Enter a non-negative number and code will display all numbers which are divisible by 3 or 5 until that number:203569101218
Read Details