What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-26 13:01:16
addition of array in python with input
#Python program to add all the array elements using the built-in function lst = [] num = int(input("Enter the size of the array: ")) print("Enter array elements: ") for n in range(num): numbers = int(input()) lst.append(numbers) pr... Add solution -
Python 2021-10-26 07:46:14
odd or even in python
# Python program to check if the input number is odd or even. # A number is even if division by 2 gives a remainder of 0. # If the remainder is 1, it is an odd number. num = int(input("Enter a number: ")) if (num % 2) == 0: print("{0} i... Add solution -
Python 2021-10-25 01:18:05
empty clear delete a list
# Python program to clear a list # using clear() method # Creating list GEEK = [6, 0, 4, 1] print('GEEK before clear:', GEEK) # Clearing list GEEK.clear() print('GEEK after clear:', GEEK) Add solution -
Python 2021-10-24 12:51:18
fibonacci sequence python 2.7
#Python program to generate Fibonacci series until 'n' value n = int(input("Enter the value of 'n': ")) a = 0 b = 1 sum = 0 count = 1 print("Fibonacci Series: ", end = " ") while(count <= n): print(sum, end = " &quo... Add solution -
Python 2021-10-24 02:51:06
do intersection between list python
# Python program to illustrate the intersection # of two lists in most simple way def intersection(lst1, lst2): lst3 = [value for value in lst1 if value in lst2] return lst3 # Driver Code lst1 =... Add solution -
Python 2021-10-20 03:12:09
python sha256 of file
# Python program to find SHA256 hash string of a file import hashlib filename = input("Enter the input file name: ") sha256_hash = hashlib.sha256() with open(filename,"rb") as f: # Read and update hash st... Add solution -
Python 2021-10-18 22:38:10
fibonacci program in python
#Python program to generate Fibonacci series until 'n' value n = int(input("Enter the value of 'n': ")) a = 0 b = 1 sum = 0 count = 1 print("Fibonacci Series: ", end = " ") while(count <= n): print(sum, end = " &quo... Add solution