1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
4 years ago
14

Python 3 (not java)1.Assume that word is a variable of type String that has been assigned a value. Write an expression whose val

ue is a String consisting of the last three characters of the value of word. So if the value of word were "biggest" the expression's value would be "est".2.Given three String variables that have been given values, firstName, middleName, and lastName, write an expression whose value is the initials of the three names: the first letter of each, joined together. So if firstName, middleName, and lastName, had the values "John", "Fitzgerald", and "Kennedy", the expression's value would be JFK". Alternatively, if firstName, middleName, and lastName, had the values "Franklin", "Delano", and "Roosevelt", the expression's value would be "FDR".3.Write an expression that evaluates to True if and only if the variables profits and losses are exactly equal.
Computers and Technology
1 answer:
zhenek [66]4 years ago
8 0

Answer:

#part 1.

#declare and initialize string variable word

word="welcome"

# extract the last 3 characters of the string and print

print("last 3 characters of word is: ",word[-3:])

#part 2.

#declare and initialize string variables

firstName="John"

middleName="Fitzgerald"

lastName="Kennedy"

#print the initials of all names

print("initials of name is: ",firstName[0]+middleName[0]+lastName[0])

#part 3.

#declare and initialize profit and loss

profits=10

losses=10

# if will be true only when profits equals to losses

if profits==losses:

   print("both are equal")

Explanation:

In part 1, declare and initialize string variable word with "welcome" then extract last 3 characters of the string and print it. In part 2, declare and initialize names variable then find the first character of each name that is character at 0 index. Append all 3 and print that value. In part 3, declare and initialize profits with 10 and losses with 10. In the if condition, it will print  "both are equal" if both values are equal.

Output:

last 3 characters of word is:  ome                                                                                            

initials of name is:  JFK                                                                                                    

both are equal

You might be interested in
Which are characteristics of a good topic sentence?
Pavlova-9 [17]
A good topic sentence provides the reader with an indication of what will follow in the rest of the paragraph.
It contains both a topic and a controlling idea or opinion. 
It is clear and easy to follow.
It does not include supporting details. It is to the point. 
A good topic sentences engages the reader by using interesting vocabulary.
I hope that this helps. 
Please mark Brainliest if you believe that I deserve so.
7 0
4 years ago
Jacob is a website designer. Whenever his company takes on a new project, Jacob takes the initiative and comes up with ideas and
Troyanec [42]
Eating a potato is what hes using
3 0
3 years ago
A(n) is a list of commands that tell your computer what to do.
Leviafan [203]
A program is a list of commands that tell your computer what to do<span />
7 0
3 years ago
Read 2 more answers
A computer cannot boot if it doesn't have ?
aliina [53]

Answer:

without an operating system, a computer cannot boot, as it also provides services for the computer programs.

Hope This Helps!!!

3 0
2 years ago
Read 2 more answers
Usually, in organizations, the policy and mechanism are established by the:
Ivanshal [37]

Answer:

Sorry Sorry Sorry

Explanation:

Sorry Sorry Sorry

5 0
3 years ago
Read 2 more answers
Other questions:
  • . A technology professional keeping up-to-date on current developments may find it valuable to
    13·1 answer
  • How do you send a private message on facebook to someone who is not your friend?
    9·1 answer
  • Can I recover pics I deleted like 9 months ago? ​
    13·2 answers
  • Pls help is very urgent and I will mark u as brainliest plsssss​
    11·2 answers
  • An array of Strings, names, has been declared and initialized. Write the statements needed to determine whether any of the array
    9·1 answer
  • Usually, the same software that is used to construct and populate the database, that is, the DBMS, is also used to present ____.
    11·1 answer
  • To print the number of elements in the array named ar, you can write :
    10·1 answer
  • Sorry but, what are brainliest for?
    7·2 answers
  • What are the common uses of joysticks? ​
    12·1 answer
  • A hacker is trying to gain remote access to a company computer by trying brute force password attacks using a few common passwor
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!