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
Output
Multiple lines containing an integer.
1
8
64
343
512
.
.
.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
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
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 objects, references, 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 arguments, parameters, objects, 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:
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”,