The first number
Write a function to receive numeric and if that number,The first numberWas TRUE and otherwise False returned
Write a function to receive numeric and if that number,The first numberWas TRUE and otherwise False returned
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
num = int(input("please enter the number you want to check\n")) if num > 1: for i in range(2, num): if (num % i) == 0: print("the number is not prime, false") print(str(i) + " times " + str(num//i) + " is "+ str(num)) break else: print("the number is prime,true") elif(num == 1): print("the number is not prime") else: print('enter a positive value')
def x(n): for i in range(2,n): if n % i == 0: return False return True num = int(input("num: ")) if x(num): print("True") else: print("False")
n = int(input("number:")) numbers=[] for i in range(2,n+1): numbers.append(i) for g in range(2 , max (numbers)): for i in range(g, max(numbers)): if i*g in numbers: numbers.remove(i*g) print("***") if n in numbers: print(n," is a prime number.") else: print(n," is not a prime number.")
while True: try: number = int(input("Enter number: ")) if number <= 0: print("Enter a positive number") continue break except ValueError: print("Invalid Input!") result = True if number == 1: result = False for i in range(2, number): if number % i == 0: result = False break print(result)
def is_prime(n): # Check if n is less than 2 if n < 2: return False # Survey of division from 2 to attraction n for i in range(2, int(n**0.5) + 1): if n % i == 0: return False return True # Example to use the function number = int(input("عدد را وارد کنید: ")) if is_prime(number): print(f"{number} عدد اول است: True") else: print(f"{number} عدد اول نیست: False")
num = int(input("enter your number:")) x = True for i in range(2,num): if num % i == 0: print(False) break else: print(x)
def Aval(n) :
count = 0
for i in range(1 , n + 1) :
if n % i == 0 :
count += 1
if count == 2 :
return True
else :
return False
Submitting answers is currently unavailable.
Write a program that can obtain the average infinite number of numbers: First, the program must receive the user's numbers (until the user does not enter the number 0, the numbers must continue ...
Write a program that receives a number of input and the factoriel calculates and prints it
Online Store with the following features to add new product by Admin in the Management Panel Panel User Name by User Selecting and Registering (Online Payment and Home Payment Option ...
Write a program that receives a text and a word from the user, search the word in the text, and as the example below and then put the word * and print the text in the output. Example: Input1: Hello. My name is hooshang. I ...
Write a library program that has the following features: 1- The user can register a new book 2- The user can delete recorded books 3- The user can change the specifications of the books including their name and subject ...
Write a program that receives a student's lessons and the number of each unit (receiving the score and the number of units until the number is 0).
CSS Code Write to select all spans that are directly inside DIV and change the color of their text to red
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.