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]
3 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]3 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
Eight what makes one character
garri49 [273]
8 bits make a byte or a character.
7 0
3 years ago
Which diagram is used as a popular technique for investigating causes and effects? 1. Cause and effect 2. Fishbone/lshikawa 3. R
pishuonlain [190]

Answer: 2)Fishbone/lshikawa

Explanation: Fishbone diagrams are those diagrams which help in the identification of the problem causing factors and reasons behind.This diagrams find the roots of the problem to solve it. Fishbone diagram is also known as the Ishikawa diagram.

The other given options are incorrect because they are not any technique for finding the roots of the problem.Thus, the correct option is option(2).

8 0
3 years ago
Jacob has a text file open, and he is typing on the keyboard. What is the best description of how the
vichka [17]

Answer:

The new version is kept in a special virtual space; the file is only changed when he clicks “save.”

Explanation:

I took the test and got it correct.

7 0
3 years ago
Nicotine us a dangerous chemical found in Cigarettes; it is accompanied by two other very harmful chemicals. These are
NNADVOKAT [17]

Answer: Carbon Monoxide and Tar.

4 0
3 years ago
Công dụng của đồng hồ đo điện:vôn kế, ampe kế, oát kế
Lostsunrise [7]

Answer:

I wonder what are you saying?

Explanation:

Please give me brainliest :)

4 0
3 years ago
Other questions:
  • In what stage of writing does publishing occur
    14·1 answer
  • By default, a word document generally displays in ____ view.
    9·1 answer
  • Suppose we provide a new implementation of the transport layer protocol tcp providing the same functionality using different alg
    14·1 answer
  • Why would an IT technician ever have to change out a computer’s motherboard?
    5·2 answers
  • Crop marks are used on an illustration to indicate to the printer the
    10·1 answer
  • This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.
    14·2 answers
  • What kind of company would hire an Information Support and Service employee?
    7·1 answer
  • Which of the following is a benefit, as well as a risk, associated with peer-to-peer networks?
    6·2 answers
  • How do you respond to an email?
    6·1 answer
  • Fill in the blanks:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!