Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Programming, Please help me answer these 10 small questions. #What will the following programs print one mark for each correct answer #Total 30 marks

Python Programming, Please help me answer these 10 small questions.

image text in transcribed

image text in transcribed

#What will the following programs print one mark for each correct answer #Total 30 marks ## 01 2marks sentence = "Humming bird in the garden" L = sentence.split("") print("Number of words:", len(L)) ## Q2 2marks name = "Random Kindness" L= name.split() print("{0:s}, {1:s}".format(L[1], L[O])) ## Q3 2marks name = "Random actof Kindness" L= name.split() print("Middle Name:", L[1]) ##Q4 1mark #empty tuple my_tuple = ( print(my_tuple) ##05 1mark #tuple having integers my_tuple = (1, 2, 3) print(my_tuple) ##Q6 1mark #tuple with mixed datatypes my_tuple = (1, "Hello", 3.4) print(my_tuple) ##Q7 1mark #nested tuple my_tuple = ("mouse", (8,4, 6), (1, 2, 3)) print(my_tuple) ##Q8 4marks # tuple can be created without parentheses my_tuple = 3, 4.6, "dog" print(my_tuple) #tuple unpacking is also possible a, b, c = my_tuple print(a) print(b) print(c) ##Q9 2marks # Nested List n_list = ["Happy", [2,0,1,5]] # Nested indexing print(n_list[0][1]) print(n_list[1][3]) ##Q10 2marks my_list = ['p','/','o','b', 'e'] print(my_list[-1]) print(my_list[-5])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago