What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-02 20:46:09
christmas tree program in python
tree_height = input("Enter the tree height : ") tree_height = int(tree_height) spaces = tree_height-1 hashes = 1 stump_spaces = tree_height-1 while tree_height != 0 : for i in range(spaces): print(' ', end="") for i in... Add solution -
Python 2022-02-02 18:20:43
n natural numbers
Method 1: num = int(input("Enter the Number:")) value = 0 for i in range(1, num+1): value = value + i print("Sum of N natural numbers:", value) Method 2: num = int(input("Enter the Number:")) sum = (num * (num+1))/2 ... Add solution -
Python 2022-02-01 10:16:34
python record audio from microphone
import pyaudio import wave CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, ... Add solution
Best helpers
Ranking is empty