Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

4. What's in There?

by CodeChum Admin

Let's try defining the size of the list and create the contents of it on our own! And then, to give off a sense of excitement, let's try accessing the value of a list element in a random index position!

Let's do this fast!

Input

The first line contains an integer n which is the size of the array.

The next n lines contains a string on each.

The last line contains an integer which is the index to be accessed and printed.

6
Learning
Programming
made
easy
with
Cody!
5

Output

A line containing a string.

Cody!




3. Decimal Count-off

by CodeChum Admin

Counting off a list of decimal numbers is hard when you speak it, but not when you code it! Don't believe me? Then let's try coding just that!


Instructions

  1. A list containing 10 predefined float values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last list element down to the first.

Output

Multiple lines containing a decimal number.

5.1
5.5
4.00001
4.024
3.0
3.66
2.5
2.2
1.2054
1.4

2. Cubes and Squares

by CodeChum Admin

You can also make a list of numbers, ey? Let's go and have some fun in tweaking the values of each element, but let's give it some twist to add on some fun to the code.


Let's have a go at it!


Instructions:

  1. An array containing 40 integer elements is already provided for you in the code editor below.
  2. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.

Instructions

  1. A list containing 5 integer elements is already provided for you in the code editor below.
  2. Using loops and conditions, print out the cube of the list element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.

Output

The squares and cubes of the elements in the array.

4
1
1
8
27
.
.
.

1. String Replacement

by CodeChum Admin

Lists are fun to make, but it's even better to add or remove things from it when it's not usable anymore, right? Let's do just that in this problem now!


Instructions

  1. Create two variables that will accept string values.
  2. A list containing three string values is already given to you in the code editor on the side. First, insert the first inputted string to the end of the list.
  3. Then, insert the second inputted string into the beginning of the list.
  4. There are now 5 elements on the given list. Now, remove the 3rd element of the list. Apply the concept of index positions in order to access the 3rd string element and successfully remove it from the list.
  5. Print out the remaining contents on the list, each separated by a new line, using loops.

Input

Two lines containing a string.

fun
Python

Output

A line containing a string.

Python·is·really·fun

a = input("Enter an animal: ")

s = input("Enter a sound: ")

e = "E"

print("Old Macdonald had a farm "+ e)

print("And on his farm he had a" + a + "," + e)

print("With a " + a + "-" + a + " here and a " + s + "-" + s + " there")

print("Here a "+ s+ " there a " +s)

print("Everywhere a" + s + "-" + a )

print("Old Macdonald had a farm, " + e)


Can you please figure this out.


write a program the temperature value is 25 C the output is 25.0C and 77.of and 298.0k in python


write a program if input is temperature as 25 output is 25.0c and 77.0f



draw a flowchart of connecting django project to database


Write a python application using the concepts of multithreading for a flower

shop where flowers are delivered based on order using Synchronization.


Write a simulation program with Synchronization for the fruit market. The

farmer will be able to produce different types of fruits (apple, orange, grape,

and watermelon), and put them in the market to sell. The market has limited

capacity and farmers have to stand in a queue if the capacity is exceeded to

sell their fruits. Consumers can come to the market any time and purchase

their desired fruits; and if the fruits they want to buy runs out, they are

willing to wait until the supply of that kind is ready. (Hint: implementing

this market will encounter the producer and consumer problem, and it

probably needs multiple buffers for different kinds of fruits).


LATEST TUTORIALS
APPROVED BY CLIENTS