P

@Pradyun101613

Use of logical operators

Python
6 months ago
# You used the if elif statement to handle multiple conditions. # What if you have 10 conditions to evaluate? Will you write 10 if..elif statements? # Is it possible to check for more than one condition in a single if statement or elif statement?

Checking One way or the other

Python
6 months ago
# If you had to evaluate multiple conditions, how would you do it? # Would the if statement handle multiple conditions? # First let us look at single conditions again and then move to multiple conditions. """------Task 1: Positive or Not --------

Conditional Statements

Python
6 months ago
# Answer the below questions either with a Yes or a No # Are you a June born? No # Do you like Harry Potter books? Yes # Do you have a sibling? Yes # How did you decide on the response? # You knew for the questions asked, the answer was either true

Even or odd

Python
7 months ago
num = int(input("Enter a number\n")) x = num % 2 if x == 0: print(f"{num} is even.") elif x != 0: print(f"{num} is odd.") else: print("Please try again.")

Math Fun

Python
7 months ago
# You are a part of the sports committee in your apartment complex. # The committee head wants your help in developing a rectangular piece of land into a playground # Are you ready to use your Python programming skills in solving the issue. """----

Python Mysteries

Python
7 months ago
# Are you ready to witness some Python mysteries.Lets check it out. """-----------Task 1: What's in store? ---------------""" print(" ") print("*** Task 1: ***") #By now you are aware of the different arithmetic operators as well as the data types.

Escape Characters

Python
7 months ago
# You have learnt integers and float data type. # Shall we try some simple hacks to work with String data type. # Let's get started!! """-----------Task 1: Lets Escape!! ---------------""" print(" ") print("*** Task 1: ***") # Suppose you want to

Float

Python
7 months ago
# What if you have a variable of int data type but now want it to be used with values with decimals? # Can you convert an integer data type to float data type? # Do you know of functions that can help in conversion? # Let us take a look """-------

Data types

Python
7 months ago
# In the previous class you learnt how to use: # - Arithmetic operators with variables. # - BODMAS in Python programs # Today you will learn about types of data, variables can store. # Look at the lists given below. # Each list has an odd one, who h

Relativity

Python
8 months ago
# Have you ever tried to measure a shadow? # Did you know you can measure larger objects like a cliff or a highrise building by measuring its shadow? '''*****Task 1: Cliff Measure*****''' print(" ") print("*** Task 1:***") # A rock climber wants t

Variable challenge

Python
8 months ago
# Do you know in a computer program a variable can hold different values? # In Python a variable can hold different values at different times. # Let us take a look '''******Task 1:Task 1: Variable Challenge*****''' print(" ") print("*** Task 1:***

Temperature Converter

Python
8 months ago
# Do you know what is the normal temperature for human beings? # What happens when you get fever?[Wait for the answer] # Do you know the instrument used to check the temperature of your body? # Do you know what is the unit to measuring temperature?

BODMAS

Python
8 months ago
# What if you have an arithmetic problem with multiple operators and some in brackets? # Do you know how to solve that? # Have you heard of BODMAS?. '''*****Task 1: BODMAS - Setting the order******''' print(" ") print("*** Task 1:***") # Does BOD

Arithmetic Operators

Python
8 months ago
print("'hello'") # In the previous class you used the +, -, * and / operators on numbers . # Today let us solve some challenging problems. # To do this, you need to learn some more operators '''*****Task 1: Fastest Finger First******''' print(" "

Swapping Numbers

Python
8 months ago
# Can you write a program to swap values of two variables # So what is swapping? # Swapping means interchanging the values in those variables. # Let us look at an example: # Initial values in a and b is : a = 5 and b=7 # We want the values to be

Building a Calculator

Python
8 months ago
# Are you up for some math by building a simple addition calculator. '''*****Task 1: Additive Calculator*****''' print(" ") print("*** Task 1:***") # Can your program take two numbers from the user and print the sum of the two numbers? # Uncomment

Arithmetic Operators + Variables

Python
8 months ago
'''*****Task 1: Your Lucky Number*****''' print(" ") print("*** Task 1:***") # Let's have some fun. # Uncomment the next 4 statements given below one line at a time and check the output myLuckyNumber=input("Enter Your Lucky Number:") print(myLuckyN

Inputs

Python
8 months ago
'''********Task 1: Input*****''' print(" ") print("*** Task 1:***") # Uncomment the next line and take a look at it NAME = input() # The input keyword, takes the name from the user and keeps the stores the value in the variable called NAME # On the

Vairables

Python
8 months ago
'''***********Task 1: What is a Variable *****************''' print(" ") print("*** Task 1:***") # Variables are data that changes # It is also a placeholder or a container that hold the data # Let’s store a name in a variable. # To do that, we

Printing about myself!

Python
8 months ago
# How do you introduce yourself when you meet someone? [Wait for the student to respond] # Are you ready to use the print statement to create a write up about yourself. ''' Task 1: About Me''' print() print ("**** Task 1: *****") # Write a program