First numbers
Write a program that receives numeric as A from the input andAll the first numbers smaller than aPrint in the output
Write a program that receives numeric as A from the input andAll the first numbers smaller than aPrint in the output
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
a=int(input("adad:")) while a>0: a-=1 print(a)
Not correct
It's wrong
def prime_number(number): if number<1: return false for num in range(1,number): if num % num==0 and num % 2 !=0: print(num) input_umber=int(input("inter number: ")) print(prime_number(input_umber))
aval=True num=int(input("please enter number: ")) num-=1 while num>1: div=num-1 aval=True while div>1: if num%div==0: aval=False break div-=1 if aval: print(num) num-=1
def prime(n): my_set = set() li = [] for i in range(2, n): if i in my_set: continue for j in range(i*2, n, i): my_set.add(j) li.append(i) return li num = int(input("enter num: ")) print(prime(num))
a = int(input("add: ")) x = 2 if a < 2: print ("avval nist") elif a == 2: print ("avval ast") else: while (x < (a//2)): if (a % x) == 0 : print("avval nist") break x = x + 1 else: print("avval ast" )
a = int(input("add: ")) j = 2 if a < 2: print ("avval nadarim") elif a == 2: print (a) else: while (j <= a): x = 2 while (x <= (j//2)): if (j % x) == 0 : j = j + 1 break x = x + 1 else: print(j) j = j + 1
a = int(input("Enter :"))
if a < 2 :
print ("Aval nist")
else :
for i in range(2 , a) :
if a % i == 0 :
print ("Aval nist")
break
else :
print ("Aval")
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up 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.