CodeTantra Python Programming L4 Solution

Hello Coders, In this blog post, you will find all the Solutions to the L2 questions of the Codetantra Python Programming Course. Here are the answeres to these questions:- 

Codetantra Python programming L4

Q1:- L4/Expressions and Statements/Understanding Expressions :- Understand and fill the missing code given, to know about expressions and statements.

number1 = 20.50

number2 = 38.25

# Print the multiplication of number1 and number2 using * operator.

print (number1 * number2)

string1= “Amazon”
string2 = “River”

# Print the concatenated value of string1 and string2 using +

print(string1+ string2)

Q2:- L4/Expressions and Statements/Understanding Statements - Print statements :- Select all the correct statements from the given options.

In Python, Statements are executed by Interpreter.

2=a, is a valid assignment statement in Python.

The association of a value to a variable is called as Binding.

In Python, assignment statement starts with the keyword assign.

a=b+a*b is a valid statement in Python.

Q3:- L4/Expressions and Statements/Types of Assignment Statements :-write a python program to do the following
1. Create a variable message and assign "Welcome to Python" to it.
2. Print the variable message
3. Create a variable number and assign 45 to it.
4. Add 5 to the variable number by using number number + 5
5. Print the variable number

message = “Welcome to Python”

print(message)

number = 45

number = number + 5

print(number)

Q4:- L4/Expressions and Statements/Augmented Assignment Statement :- Select all the correct statements from the given options

x*= y means x*x = y

We can perform assignment with ‘=’ operator.

a -= b and a = a-b are gives same result.

Q2.1:-L4/Indentation/What is an Indentation :- Follow the instructions given in comment lines in the program and complete the code to understand the Indentation in python.

if 100.0 >10.0:

      print(“Small Value:”, 10.0)

else:

     print(“Large Value:”, 100.0)

Q2.2:- L4/Indentation/A simple program in Python :- Change the text in the code given to make the program print "Hello Python" instead of "Hello Basic".

print(“Hello Python”)

Hope this blog post was helpful to you and you have got the answer to your question. Thank you for visiting our blog. If you have any doubts about any coding questions then let us know in the comments section we will answer them as soon as possible. Till then check out our more blog posts.

Leave a Comment

Your email address will not be published. Required fields are marked *