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

3. Not my Favorites

by CodeChum Admin

We've already done looping through a series of numbers and printing out its squares, so how about we level it up and go with cubes this time?


I have a condition though; I don't want to be associated with numbers that are divisible by 3 or 5 so if an integer is divisible by either of the two, don't make their cube values appear on the screen, please.


Care to fulfill my request?


Instructions

  1. Print out the cube values of the numbers ranging from 1 to 10 (inclusive). However, if the number is divisible by either 3 or 5, do not include them in printing and proceed with the next numbers.
  2. Tip: When skipping through special values, make use of the keyword continue and put them inside a conditional statement.


Output

Multiple lines containing an integer.

1
8
64
343
512
.
.
.

2. Found Ya!

by CodeChum Admin

Let's now try finding a certain digit into an integer! Come and join in on the fun and code with me!


Instructions

  1. Create two variables assigned to an input() function. The first one shall accept any integer from 0-9 and the other one shall take a random positive integer. All the needed values are to be inputted in one single line.
  2. Using loops, identify if the number (0-9) is present in the given positive integer. If it is found, print "Yes"; else, print "No".
  3. Tip: If the number is already found even without reaching the end of the loop, use the break keyword to exit the loop early for a more efficient code.

1. Finding Letters

by CodeChum Admin

We've already counted digits before on a certain number, so how about doing it on strings and characters? There's a catch, though, since you're only going to count and see if the character exists at least twice in a string.


Are you up for the challenge?

Instructions

  1. Create two variables and assign them to an input() function. The first variable shall accept a single letter and the second variable shall store the inputted string.
  2. Using loops, count the number of times that the single letter appears on the inputted string, and when it appears at least twice in the string, print "Cody is really awesome"; else, print "Cody rocks".
  3. Tip: to make your code more efficient, use the break keyword to terminate the loop whenever the count of appearance of the single letter has already reached 2.

Describe the difference between objects and values using the terms “equivalent” and “identical”. Illustrate the difference using your own examples with Python lists and the “is” operator.  

Describe the relationship between objectsreferences, and aliasing. Again, create your own examples with Python lists.

Finally, create your own example of a function that modifies a list passed in as an argument. Describe what your function does in terms of argumentsparametersobjects, and references

Create your own unique examples for this assignment. Do not copy them from the textbook or any other source.

print the sum of an array and the array 1-d


convert ten digits into a string:

rules for conversion:

  1. separate the number into a set of four-three-three
  2. Two consecutive numbers: double
  3. Three consecutive numbers: triple
  4. Four consecutive numbers: quadruple

sample input:9966777819

output should be:double nine double six triple seven eight one nine


sample input: MATHEMATICS

output should be:M A T H E I C S

sample input2:banana

outputshould be:b a n


Create a list containing country name and the population. Get a country name from user, display the population in that country. Display the countries whose population is less than one lakh. Display also the countries with minimum and maximum population.


A tuple have details about a hospital. The details are ward number, number of adults and number of children in that ward. There are n wards in the hospital. Display the number of adults in the ward number specified by the user (doctor). Display the ward that has maximum children


Write a python function that takes a string as an argument. This string will be a simple valid expression containing only characters “a”, “b”, “c” and “+”. Some examples of the input string: “a+b+c”, “a”, “a+a+b”.


Your function will have to return a string which will be a simple version of the input string. For example, if the input is “a+a+b”, output will be “2*a+b”,


LATEST TUTORIALS
APPROVED BY CLIENTS