Questions: 5 290

Answers by our Experts: 5 288

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

Q5:     Create a list containing the following 3 elements:


your favorite color

the number of pets you have

a boolean value describing whether you have previous programming experience


Q6:     Complete the following print and if statements by accessing the appropriate elements from my_list.


Hint: Use the list indexing notation [].

 

print('My favorite color is', ???) print('I have {} pet(s).'.format(???)) if ???:

print("I have previous programming experience") else:

print("I do not have previous programming experience")


Q7:     Add your favorite single digit number to the end of the list using the appropriate list method.

Q8:     Remove the first element of the list, using the appropriate list method.

Q9:     Complete the print statement below to display the number of elements in my_list. print("The list has {} elements.".format(???))


Q11: A travel company wants to fly a plane to the Bahamas. Flying the plane costs 5000 dollars. So far, 29 people have signed up for the trip. If the company charges 200 dollars per ticket, what is the profit made by the company?


 

Fill in values or arithmetic expressions for the variables below.


cost_of_flying_plane = ??? number_of_passengers = ??? price_of_ticket = ???

profit = ???

print('The company makes of a profit of {} dollars'.format(profit))

Q11b Out of the 29 people who took the flight, only 12 buy tickets to return

from the Bahamas on the same plane. If the flying the plane back also costs 5000 dollars, and does the company make an overall profit or loss? The company charges the same fee of 200 dollars per ticket for the return flight. (Optional)


Use an if statement to display the result.



if a given integer in "N". write a program to print the right angled triangle pattern of "N" rows and there is a lhytopenus line using "/" of same number

-------
|
|
|
|
|
|
|

Q11: A travel company wants to fly a plane to the Bahamas. Flying the plane costs 5000 dollars. So far, 29 people have signed up for the trip. If the company charges 200 dollars per ticket, what is the profit made by the company?


 

Fill in values or arithmetic expressions for the variables below.


cost_of_flying_plane = ??? number_of_passengers = ??? price_of_ticket = ???

profit = ???

print('The company makes of a profit of {} dollars'.format(profit))

Q11b Out of the 29 people who took the flight, only 12 buy tickets to return

from the Bahamas on the same plane. If the flying the plane back also costs 5000 dollars, and does the company make an overall profit or loss? The company charges the same fee of 200 dollars per ticket for the return flight. (Optional)


Use an if statement to display the result.



Assign your name to the variable name.

Assign your age (real or fake) to the variable age.

Assign a boolean value to the variable has_android_phone.

Create a dictionary person with keys "Name", "Age", "HasAndroidPhone" and values using the variables defined above.

Use a for loop to display the type of each value stored against each key in person.


write a program to find the first prime number in the given inputs


First and last digits

Given two numbers M and N, write a program to count of the numbers which have the same first and last digits in the given range M to N(inclusive M and N)


Input

the first line of input will contain a positive integer M.

the second line of input will contain a positive integer N.

output

The output should be an integer denoting the count of the numbers in the range which meet the given condition.


Explanation

For example, if the given number are M is 5and N is 30, the numbers which have the first and last digit equal in the given range(5,6,....29,30) are 5 6 7 8 9 11 and 22. so the output should be 7.


sample input 1

5

30

sample output 1

7

sample input 2

1

10

sample output 2

9


Elements of anti diagonal

Write a program to print the anti-diagonal elements in the given matrix.


input

The first line of input will contain an integer N, denoting the number of rows and columns of the input matrix.

the second line of input will contain N space-separated integers denoting the elements of each row of the matrix.


output

The output should be a list containing the anti-diagonal elements.


explanation

For example, if the given N is 3, and the given matrix is

1 2 3

4 5 6

7 8 9


The anti-diagonal elements of the above matrix are 3 5 7. so the output should be the list

[3, 5, 7]


sample input 1

3

1 2 3

4 5 6

7 8 9

sample output 1

[3, 5, 7]

sample input 2

5

44 71 46 2 15

97 21 41 69 18

78 62 77 46 63

16 92 86 21 52

71 90 86 17 96

sample output 2

[15, 69, 77, 92, 71]


Interleave String

Given two strings, write a program to merge the given two strings by adding characters in alternating order, starting with the first string. If a string is longer than the other, append the additional characters onto the end of the merged string.

input

the first line of input will containing a string.

the second line of input will containing a string.

the strings may contain special characters ,digits and string.

output

the output should be the merged string

explanation

For example, if the given strings are "abc" and "pqrs", then alternating characters from each string are merged as "a" from "abc", "p" from "pqr" "b" from "abc" and so on ...., resulting in the merged string "apbqcr".

sample input 1

abc

pqr

sample output 1

apbqcr

sample input 2

abc

pqrst

sample output 2

apbqcrst


Yes your output is right thank you, but I am sorry I am not expecting this output,



Input: 1



3




Your output: 1



2



3




My expecting output : 1 2 3




Please review

LATEST TUTORIALS
APPROVED BY CLIENTS