Don't you find it amazing to discover words and sentences that have the same first and last letter? We just don't usually notice them, so we can try it out by coding out this problem instead! Print out "Yes" if the first and last characters of the given string are the same, and "No" otherwise. It doesn't matter if they're in lowercase or uppercase, as long as it's the same letter, it fits the description.
So, what are you waiting for? Code now!
Input
A line containing a string.
Pop·it·up
Output
A line containing a string.
Yes
There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 outputted values and print out the result.
Go and search for the positive ones among these four!
Input
A line containing four numbers (may contain decimal places) separated by a space.
2·-4·3.6·1
Output
A line containing an integer.
3
Create a program that would accept two (2) user inputs and will be display the sum, difference, product, quotient, and, power of these user inputs. Refer to the following sample output of the program.
Sample Program Output
SIMPLE CALCULATOR
—————————————————
Enter 1st Number:
4.25
Enter 2nd Number:
2.5
—————————————————
Sum: 6.75
Difference: 1.75
Product: 10.625
Quotient: 1.7
Power: 37.2367976813595
determine what's wrong in this code. why x is not defined? Show the correct code.
x.field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
list1 = [
["Adelaide", 1295, 1158259, 600.5],
["Brisbane'', 5905, 1857594, 1146, 4],
[ "Darwin", 112, 120900, 1714, 7],
["Hobart", 135, 20556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Perth", 5386, 1554769, 869.4]]
for i in list1:
x.add_row(i)
Write an if/else statement that compares sold_yesterday and sold_today, and based upon that comparison assigns sales_trend the value -1 (the case where sold_yesterday is greater than sold_today) or 1.
Assume that word is a String variable. Write a statement to display the message "Today's Word-Of-The-Day is: " followed by the value of word. The message and the value of word should appear together, on a single line on standard output
Write an if/else statement that compares sold_yesterday and sold_today, and based upon that comparison assigns sales_trend the value -1 (the case where sold_yesterday is greater thansold_today) or 1.
Write an if/else statement that assigns True to fever if temperature is greater than 98.6; otherwise it assigns False to fever.