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 function that receives a string and returns the number of letters: To solve this question, you should not use ready-made functions for example: get_len ('code-bezan.ir') # 13
Write a function that receives a number and specifies or not to be paired by returning TRUE or FALSE
Write a program that receives any professors including name, age and city from the entrance.
Write a function that receives infinite parameter and returns the average of numbers. If the parameter was non -extensive, it ignores it
Write a program that receives a text from the user as an input and all the words used in the text, along with the number of repeating them to the user, such as: Input: This is an Example. This is a text ... ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.