New course!
Every coder should learn
Generative AI!
Try a free lesson
Courses
Courses
Code Compiler
Code Compiler
Discuss
Get Pro
Teams
Log in
Register
Menu
Q&A Discussions
Search
Search
Ask a question
Ask a question
How can I get index (1) with values of 4 list [1, 2, 3, 1] on python
python
0 Votes
5 Answers
20th Dec 2019, 1:59 PM
dany setyawan
Num = [10, 11, [ 100, 200, [ 1, 2, 3]], 120]. Num[2][2][1] = 500
lists
python
0 Votes
4 Answers
23rd Jul 2017, 1:41 PM
sunandan
How can I open a txt file in my functions 1 and 2, I am struggling
python3
1 Vote
2 Answers
10th Mar 2022, 2:27 AM
Megan Lott
list = [1, 2, 3, 4] if (list) % 2 == 0 : print(list[ ]) anyone help?
python
-5 Votes
8 Answers
24th Mar 2017, 12:17 PM
Jay Sibley
Write a program to print multipication table of 2, 3 ,4,5 using while loop.
java
-1 Vote
2 Answers
24th Jan 2017, 12:19 PM
jatin arora
fib = {1: 1, 2: 1, 3: 2, 4: 3} print(fib.get(4, 0) + fib.get(7, 5))
dictionaries
python
1 Vote
2 Answers
9th May 2017, 4:28 AM
AJITH KUMAR
Write a program that prints the first 100 members of the sequence 2, - 3, 4, -5, 6, -7, 8.
c#
for-loops
3 Votes
7 Answers
18th Apr 2018, 9:21 AM
Samuel DANISON
fib = {1: 1, 2: 1, 3: 2, 4: 3} print(fib.get(4, 0) + fib.get(7, 5))
dictionaries
python
0 Votes
1 Answer
11th Jun 2018, 5:43 AM
Saurav nalla
If I learn Python 2, would I be able to use and understand Python 3?
beginner
codecademy
programming
python
python2
python3
sololearnpython
0 Votes
2 Answers
21st Jan 2019, 7:41 PM
Thoriq Farras
nums = [1, 2, 3] print(nums * 3) >>>123123123 how to revise and get >>>246
lists
python
1 Vote
2 Answers
23rd Dec 2016, 6:01 AM
SealCLi
Someone once said that the boolean value for 0 is false but in this very short, simple and precise code, the output is 2, why?
boolean-logic
booleans
if-statements
6 Votes
7 Answers
8th Jul 2019, 8:52 PM
eMBee
Why does it trigger twice when ive only inputed 2, 3 and Y? (Relatively new to c again)
cprogramming
3 Votes
2 Answers
29th Sep 2020, 9:59 AM
Marc Stephen Gabres
#import math nums = [1, 3, 5, 2, 4] a=((len(nums)) b= a//2 if b==1: print("math.ceil(a) : ",math.ceil(a))
python3
2 Votes
1 Answer
19th Oct 2020, 6:44 PM
Abhijeet Kumar Verma
What happens if you leave a part of an array blank? Example: int myArray [3] = { 0, 2, };
arrays
c++
3 Votes
4 Answers
28th May 2018, 8:41 PM
Jeremy
nums = [1, 2, 3,5] nums(1)=nums(2)-0 if 2 in nums: nums.append 8 print(nums) else: nums.append(5) print(nums) print(nums)
error
fix
0 Votes
4 Answers
15th May 2017, 2:50 AM
chittabrata
nums = [-1, 2, -3, 4, -5] if all([abs(i) < 3 for i in nums]): print(1) else: print(2
@questions
-3 Votes
4 Answers
6th Jun 2021, 5:26 AM
Tia
int arr[] = {1, 2, 3, 4, 5}; (int x = 0; x < 5; x++) { printf("%d", [x]); }
array
6 Votes
1 Answer
17th Apr 2022, 4:14 PM
Arafat Rahon
Challenge sequence 3: 2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131...... Code it...All languages welcome
3
all_languages
challenges
code
logic
number
sequence
sololearn
3 Votes
2 Answers
4th Oct 2017, 3:59 PM
Saurabh Shah
What is the result of this code? fib = {1: 1, 2: 1, 3: 2, 4: 3} print(fib.get(4, 0) + fib.get(7, 5)).with explanation
dictionaries
dictionary
python
-1 Vote
4 Answers
16th Nov 2018, 11:29 AM
Priyanshu Ghatiya
About Average word length it get right in test 1, 2, 4 but the other is no what problem with code?
average
length
problem
word
0 Votes
5 Answers
21st Feb 2021, 6:57 AM
Abdullah Said
Is it possible to store 2, (5,12)both numbers are together, 3, (5,12), 3, (5,12) in an array in java?, if possible, how?
java
0 Votes
8 Answers
6th Sep 2018, 8:25 PM
Illegal
int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0][2] = 42; int x = myArr[1][0]; // 4
arrays
java
2 Votes
9 Answers
5th Jul 2017, 12:49 PM
Sheevika
Find the missing elements in the list - i have 1to n?array= [1, 2, 3, 4, 5, 6, 8, 9, 10]
lists
python
python3
0 Votes
3 Answers
22nd Feb 2022, 5:59 AM
Manoj Bhaagam
will it work without return! by using some variable names in line 2, i tried i couldn't make it worked😀
functions
python
1 Vote
2 Answers
19th May 2021, 7:12 PM
Hëllo Wörld🔰
How to solve this prmer: print (8 q q (1/3)). I know there will be an answer 2, but I don't know how to solve it, help.
numeric-operations
python
-1 Vote
2 Answers
26th Oct 2020, 5:24 PM
Богдан
public class Program { public static void main(String[] args) { int[ ][ ] sample = { {1, 2, 3}, {4, 5, 6} };
diy
0 Votes
6 Answers
16th Jul 2020, 10:26 AM
Saurav Menon
Подскажите логику как написать код. Под задачу загадки. 1904=2 6812=3 9081=4 7034=1 8124=? Ответ на загадку: 2, (количество 0)
puzzle
1 Vote
1 Answer
16th Nov 2019, 3:52 PM
Латыпов Ильнур
What is the problem with my code? I didnt pass the test Cases. The test enter input choice 0, 2, 8.
anonymous
class
fly
in
inner
onnthe
or
run
time
0 Votes
2 Answers
18th Jan 2023, 2:51 AM
Oliver Pasaribu
A Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and corresponding values as 'Reena', 'Rak
python
-3 Votes
3 Answers
5th Oct 2020, 4:49 AM
Arpan Pradhan
What is the output of this code? int[ ] arr = {8, 2, 6}; int y=0; foreach (int x in arr) { y+=x/2; } Console.Write(y);
arrays
c#
0 Votes
8 Answers
17th Nov 2016, 7:21 PM
Avishek Mukherjee
Is it necessary to write h1 only or we can write else than 1 like 2, 3, 33 etc.
javascript
0 Votes
2 Answers
4th Feb 2019, 2:58 PM
anamta ali
public class Program { public static void main(String[] args) { int[ ][ ] sample = { {1, 2, 3}, {4, 5, 6} };
arrays
java
2 Votes
5 Answers
25th Oct 2017, 11:56 AM
Hasrat Wadsariya
Please How do u write a code that Prints 100 members of the sequence 2, -3, 4, -5, 6, -7, 8 in C#.
for_loop
1 Vote
3 Answers
21st Jun 2019, 12:07 PM
ogba japhet
mylist = [0, 1, 2, 3, 4, 5, 6, 7] for i in mylist: mylist.remove(i) print(myList) output is [1, 3, 5, 7] Why not removing all
lists
python
1 Vote
5 Answers
4th Dec 2019, 5:32 AM
Sreeraj V A
Why repeated number are not printed in set? Does same thing happens in dictionary? nums = {1, 2, 1, 3, 1, 4, 5, 6} print(nums)
dictionaries
python
python3
sets
0 Votes
5 Answers
2nd Jul 2021, 9:06 AM
Zahed Shaikh
int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0][2] = 42; can't get this declaration?
arrays
0 Votes
2 Answers
25th Sep 2018, 2:58 PM
yoga
if nums [3] = nums [1], then nums [1] = nums [3], therefore the output will not be 2, but 4. Why then output 2?
python3
1 Vote
4 Answers
15th Aug 2020, 9:14 AM
иван
Why the Other One with (arr[k]) is 1, 2, 3 but the Other One with Just (k) is 0, 1, 2?
es6
javascript
2 Votes
2 Answers
19th Jan 2018, 1:22 AM
Vincent Matthew Benito
Если вводим red, то ввыводи 1,green - 2, black 3. Что сделать в input чтоб он видел значения red, black, green?
elif
else
if
python
type
-1 Vote
2 Answers
7th Apr 2021, 10:14 AM
константин будник
int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0][2] = 42; int x = myArr[1][0]; sop(x);
arrays
java
0 Votes
3 Answers
16th Dec 2016, 4:31 AM
Tanaji Kolekar
What is the output of this code? num = [1, 2, 3, 4] x = 1 for i in range(0, len(num)): x *= i print(x) by #RahulVerma
python
0 Votes
4 Answers
30th Dec 2022, 9:13 PM
Bilge Tandogan
a = [1,1,2,3,5,8] for a[1] in a: pass print(a) result :[1, 8, 2, 3, 5, 8] want to know how index-1 is replaced as 8.
python
2 Votes
3 Answers
22nd Nov 2019, 6:03 AM
Sreeraj V A
What was wrong with that code c++ that I created? Code only completes test 1, 2, & 3. Sory my bad english
c++
codecoach
0 Votes
1 Answer
19th Feb 2020, 9:07 AM
Ramadhan Sir
Write a simple Python program that displays the following powers of 2, one per line: 2¹ , 2², 2³ , 2^4, 2^5 , 2^6 , 2^7 , 2^
python
0 Votes
6 Answers
6th Feb 2017, 9:42 PM
Atitebi Jacob
int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; why are there only 2 [ ] in the array declaration?
arrays
1 Vote
5 Answers
21st Jan 2018, 11:40 AM
russ
What if you want to add a varying number of inputs to the function. i.e. you want it to perform addition for 1, 2, 3 , 4 or 5
function-arguments
function-parameters
1 Vote
7 Answers
9th Aug 2019, 9:26 AM
JeClives
Fill in the blanks to extract all items that are less than 5 from the list. nums = [1, 2, 5, 8, 3, 0, 7] res = list( filter
answer
-5 Votes
5 Answers
8th Nov 2020, 11:22 AM
Jack Bradshaw
Please find what's wrong in this program. When we enter run: input — 2, output — 55, expected— 55. But my 5 tests are failed
code
codecoach
java
0 Votes
1 Answer
20th Aug 2020, 7:35 AM
Irine Theresa Antony
Q12. Reverse an array in groups of given size Input: arr = [1, 2, 3, 4, 5, 6, 7, 8, 9] k = 3
python
0 Votes
3 Answers
4th Jan 2017, 3:36 PM
manish
What is the output of the below code? >>import array >>> a = [1, 2, 3] >>> print a[-3] >>> print a[-2] >>> print a[-1]
booleans
code
codeplayground
django
java
javascript
progress
python
python3
subqueries
0 Votes
2 Answers
1st Aug 2020, 10:05 AM
Nishan
Ask a question
Ask a question
Ask a question
Ask a question
< Previous
1
2
3
Next >
Hot today
[SOLVED] Average Word Length Challenge
1 Votes
Can we convert website into app
2 Votes
[Solved] Camel to Snake Python Coding Challenge
1 Votes
Help! Images! HTML!
0 Votes
The output is not working in C++. The code is good.
0 Votes
Why are my 2 radio buttons not linked
1 Votes
Python core exercise (task ) or bug -Club access man older 18 y.o.
0 Votes
I need help with python code
0 Votes
There's an example code in Python Intermediate course that makes no sense.
0 Votes
HML and JavaScript
2 Votes