- 1
Create a list of multiples of 3 from 0 to 20.
ss
15 Answers
+ 3
i think it depends on the programming language but for python for example:
lst = list(range(0,21,3))
+ 6
a = [i for i in range (20) if i%3 == 0]
+ 2
if u r facing problem on this ,then ans if a=[i for i in range(20) if i%3==0] hope it wil help u :-)
+ 2
Create a list of multiples of 3 from 0 to 20.
a =
[
i for i in range(20)
i%
3
==0]
+ 2
a = [i for i in range (20) if i%3 == 0]
+ 1
In Python you could also do,
lst = [x for x in range(0, 21) if x % 3 == 0]
+ 1
in c
#include<stdio.h>
int main()
{int k;
while(k<=20)
{printf("%d",k);
k+=3;
}
return 0}
0
Using js
=======
var list =[];
for(var i=0; i< 20; i+=3){
list.push(i);
}
0
a = [i for i in range (20) if i%3 == 0]
0
Thanks to miriam
0
ques : Create a list of multiples of 3 from 0 to 20.
Answer : a = [i for i in range(20) if i%3==0]
0
a = [i for i in range (20) if i%3 == 0]
0
vowels=['a','e','i','o','u'] # Define Vowels
word = input() # Take user Input
ans=[] # Define a List Variable for Assigning Non Vowels Words to it
for i in word: # Match each word 1 by 1
if i not in vowels:
ans.append(i) # Add each Non-Vowel Word in ans List
print(ans) # Print Answer List
- 1
1. [
2. if
3. 3
- 2
in phyton:
n= 0
while n<=20:
if (n%3 ==0):
print (n)
n= n+1