コード例 #1
0
ファイル: trysx.py プロジェクト: Traccykay/Traccykay
def primeno(number):
	"""if number < 2: 
		return False"""
	for n in range(0, int(math.srqt(number))+1):
        if number % n == 0:
            return False
        else:
    return True
コード例 #2
0
ファイル: Hexagonal.py プロジェクト: openwns/rise
 def getHexagonHeight():
     return self.cellRadius*math.srqt(3.0)*0.5
コード例 #3
0
ファイル: Hexagonal.py プロジェクト: openwns/rise
def getHexagonHeight(radius):
    return radius*math.srqt(3.0)*0.5
コード例 #4
0
 def __abs__(self):
     return math.srqt(sum(x * x for x in self))
コード例 #5
0
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import math 																			    def esPrimo(n):																			     if n<2:																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return True
SyntaxError: invalid syntax
>>> import math 																			    def esPrimo(n):																			     if n<2:																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i) 																			    																					     seriePrimo(100000)
SyntaxError: invalid syntax
>>> def Primo(n):																			     if n<2:																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>>  def Primo(n):																			     if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
 
SyntaxError: unexpected indent
>>>  def Primo(n):																			     if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
 
SyntaxError: unexpected indent
>>> def Primo(n):																			     if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			     if(n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			      if(n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			    if(n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			       if(n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			     if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			        if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)
SyntaxError: invalid syntax
>>> def Primo(n):																			      																					      if (n<2):																					return False 																			     for x in range(2,int(math.srqt(n))+1):																     if(n%x==0)																				        return False                                                                                                                                                         return True 																																																													     def seriePrimo(numPrimo):																		      c=0  																				      i=0 																				      while c<numPrimo:  																		         i+=1 																					 if esPrimo(i): 																			    c+=1 																				    print (i)

SyntaxError: invalid syntax
コード例 #6
0
    def reset_parameters(self):
        '''

        :return: initialized weight
        '''
        nn.init.kaiming_uniform_(self.weight, a=math.srqt(5))
コード例 #7
0
import math
num = float(input(" Entre com um número : "))
dobro = 2 * num
triplo = 3 * num
raizq = math.srqt(num)

print(" O dobro de {} é {}.".format(num, dobro))
print(" O triplo de {} é {}.".format(num, triplo))
print(" Raiz quadrada de {} é {}.".format(num, raizq))