This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=0 | |
b=0 | |
#Palindrome pattern : 1 | |
for i in range(1,5): | |
a=(int(pow(10,i)/9))**2 | |
print(a) | |
#Palindrome pattern : 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
complist = ["Stone","Paper","Scissor"] | |
userlist = ["Stone","Paper","Scissor"] | |
print("Welcome to the game Stone, paper, Scissor") | |
print("Please enter a value as shown") | |
print() | |
user = int(input("For stone : 0 \nFor paper : 1 \nFor Scissor : 2 \nEnter the value : ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
height = int(input("Enter height in cm :")) | |
weight = int(input("Enter weight in kg :")) | |
BMI = weight/pow((height/100),2) | |
if BMI>=30: | |
print(f"Your BMI is {round(BMI,2)} and you are Obese") | |
elif 25<=BMI<30: | |
print(f"Your BMI is {round(BMI, 2)} and you are Over Weighted") | |
elif 18.50<=BMI<25: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
data = pandas.read_csv("weather_data.csv") | |
print(type(data)) #Type checking- To check the data-type | |
data_dict = data.to_dict() #to convert into a dictionary | |
print(data_dict) | |
temp_list = data["temp"].to_list() #to convert into list | |
print(temp_list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from turtle import Turtle, Screen | |
tim = Turtle() | |
screen = Screen() | |
def move_forwards(): | |
tim.forward(10) | |
def move_backwards(): | |
tim.backward(10) | |
def turn_left(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
from turtle import Turtle, Screen | |
import random | |
timmy = Turtle() | |
timmy.shape("turtle") #change the shape of the cursor | |
turtle.colormode(255) | |
#colour=["red","yellow","green","blue","violet","indigo","brown"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=input('Enter values: ') | |
#print(type(a)) | |
x=a.split(" ") | |
#print(type(a)) | |
for i in range(len(x)): | |
x[i] = int(x[i]) | |
#print(i) | |
#print(x[i]) | |
#print(type(x[i])) |