- 1

Create a list of multiples of 3 from 0 to 20.

ss

12th Jul 2018, 9:01 AM
Patrick Mita
Patrick Mita - avatar
15 odpowiedzi
+ 3
i think it depends on the programming language but for python for example: lst = list(range(0,21,3))
12th Jul 2018, 9:22 AM
Ryu
Ryu - avatar
+ 6
a = [i for i in range (20) if i%3 == 0]
29th Jun 2020, 5:47 PM
Faith Mundi
Faith Mundi - avatar
+ 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 :-)
6th Feb 2019, 4:05 PM
Tebogo Mashiane
Tebogo Mashiane - avatar
+ 2
Create a list of multiples of 3 from 0 to 20. a = [ i for i in range(20) i% 3 ==0]
18th Jan 2020, 12:06 PM
Pradip Survase
Pradip Survase - avatar
+ 2
a = [i for i in range (20) if i%3 == 0]
31st Jan 2020, 1:06 PM
Olayinka Mariam Odufade
+ 1
In Python you could also do, lst = [x for x in range(0, 21) if x % 3 == 0]
12th Jul 2018, 10:16 AM
Satyam
+ 1
in c #include<stdio.h> int main() {int k; while(k<=20) {printf("%d",k); k+=3; } return 0}
13th Jul 2018, 10:37 AM
Vimlesh Kumar
Vimlesh Kumar - avatar
0
Using js ======= var list =[]; for(var i=0; i< 20; i+=3){ list.push(i); }
12th Jul 2018, 9:26 AM
Dlite
Dlite - avatar
0
a = [i for i in range (20) if i%3 == 0]
8th Apr 2020, 3:14 AM
Mobin Mirarab
Mobin Mirarab - avatar
0
Thanks to miriam
29th Jun 2020, 5:46 PM
Faith Mundi
Faith Mundi - avatar
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]
27th May 2021, 7:11 AM
Madhavareddy
Madhavareddy - avatar
0
a = [i for i in range (20) if i%3 == 0]
24th Mar 2023, 2:02 PM
المهندس أحمد
المهندس أحمد - avatar
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
19th Sep 2023, 11:25 AM
Muhammad Kamran Saeed
- 1
1. [ 2. if 3. 3
28th Dec 2021, 6:16 PM
Thuwayba Ahmed
Thuwayba Ahmed - avatar
- 2
in phyton: n= 0 while n<=20: if (n%3 ==0): print (n) n= n+1
17th Jul 2018, 4:27 AM
mridul gandotra