Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about one-liner

Read more about one-liner

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - one-liner

One line for loops that don't require list

I'm trying to figure out how the one line for statement works when the output is not meant to be a list. For example, if I want to print these tuples of matching x to x+10, I have the code: [print((i2...
test-img

Τιμόθεος

python

list

for-loop

output

one-liner

Votes: 0

Answers: 1

Latest Answer

The thing is that the product of your code: [print((i2x, xi2xx)) for i2x, xi2xx in zip(range(1,11), range(11,21))] is the list created by the list comprehension (since you are using the square bracke...
test-img

LUKASANUKVARI

Return an array which is iniated in a one liner

I want to return an array of my custom structure object timeInDay with as few lines as possible, in order to return a day in my time schedule. struct timeInDay[] getRingTimesForWeekDay(int day) { sw...
test-img

obe

c++

arrays

return-value

one-liner

Votes: 0

Answers: 2

Latest Answer

No line is required to return a c-array from a function, because you cannot return a c-array from a function. You could dynamically allocate it and return a pointer to first element and size, but you ...
test-img

463035818_is_not_a_number

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved