├── README.md
├── assigment.py
├── assignmet16.py
├── customer_bill.py
├── list.py
├── password.py
└── triangle.py
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
Hi 👋 , I'm Sandhya
3 | I'm interested in Artificial intelligence and DataScience
4 |
5 |
6 |
7 | - 🚶♀️ I’m currently learning **Artificial intelligence**
8 |
9 | - 🙄 I’m looking to collaborate on projects **related to Artificial intelligence**
10 |
11 | - 🎆 How to reach me **madhunagulasandhya5@gmail.com**
12 |
13 | Connect with me:
14 |
15 |
16 |
17 |
18 |
19 | Languages and Tools:
20 |
21 |
22 | 
23 |
24 | 
25 |
26 | 
27 |
--------------------------------------------------------------------------------
/assigment.py:
--------------------------------------------------------------------------------
1 | #lex_auth_012693711503400960120
2 | #Write a python program to find and display the product of three positive integer values based on the rule mentioned below:
3 |
4 | #It should display the product of the three values except when one of the integer value is 7.
5 | #In that case, 7 should not be included in the product and the values to its left also should not be included.
6 | #If there is only one value to be considered, display that value itself.
7 | #If no values can be included in the product, display -1.
8 |
9 |
10 |
11 |
12 | def find_product(num1,num2,num3):
13 | product=0
14 | if(num3==7):
15 | product=-1
16 | elif( num2==7 ):
17 | product=num3
18 | elif(num1==7 ):
19 | product=num2*num3
20 | else:
21 | product=num1*num2*num3
22 | #write your logic here
23 | return product
24 |
25 | #Provide different values for num1, num2, num3 and test your program
26 | product=find_product(7,6,2)
27 | print(product)
28 |
--------------------------------------------------------------------------------
/assignmet16.py:
--------------------------------------------------------------------------------
1 | #lex_auth_012693780491968512136
2 | #You have x no. of 5 rupee coins and y no. of 1 rupee coins.
3 | #You want to purchase an item for amount z.
4 | #The shopkeeper wants you to provide exact change.
5 | #You want to pay using minimum number of coins. How many 5 rupee coins and 1 rupee coins will you use? If exact change is not possible then display -1.
6 |
7 |
8 | def make_amount(rupees_to_make,no_of_five,no_of_one):
9 | five_needed=0
10 | one_needed=0
11 | #Start writing your code here
12 | #Populate the variables: five_needed and one_needed
13 | if(rupees_to_make )>5*no_of_five+1*no_of_one:
14 | print(-1)
15 | else:
16 | five_needed=rupees_to_make//5
17 | one_needed=rupees_to_make -(5*five_needed)
18 | print("No. of Five needed :", five_needed)
19 | print("No. of One needed :", one_needed)
20 | # Use the below given print statements to display the output
21 | # Also, do not modify them for verification to work
22 | # print("No. of Five needed :", five_needed)
23 | #print("No. of One needed :", one_needed)
24 | #print(-1)
25 | #Provide different values for rupees_to_make,no_of_five,no_of_one and test your program
26 | make_amount(28,8,5)
27 |
--------------------------------------------------------------------------------
/customer_bill.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Maithri1234/Pythonbasic/80b6a721126e27b9348b40572b11525d840b3fd1/customer_bill.py
--------------------------------------------------------------------------------
/list.py:
--------------------------------------------------------------------------------
1 | #lex_auth_012693750719488000124
2 | """Given a list of integer values.
3 | Write a python program to check whether it contains same number in adjacent position.
4 | Display the count of such adjacent occurrences"""
5 | def get_count(num_list):
6 | count=0
7 |
8 | # Write your logic here
9 | for i in range(0,len(num_list)-1):
10 | if(num_list[i]==num_list[i+1]):
11 | count+=1
12 | else:
13 | continue
14 |
15 | return count
16 |
17 | #provide different values in list and test your program
18 | num_list=[1,1,5,100,-20,-20,6,0,0]
19 | print(get_count(num_list))
20 |
--------------------------------------------------------------------------------
/password.py:
--------------------------------------------------------------------------------
1 | import string
2 | import random
3 |
4 | def generate_password(length):
5 | # Define the characters that can be used in the password
6 | characters = string.ascii_letters + string.digits + string.punctuation
7 | # Generate a random password
8 | password = ''.join(random.choice(characters) for i in range(length))
9 | return password
10 |
11 | # Prompt the user to specify the desired length of the password
12 | try:
13 | password_length = int(input("Enter the desired length of the password: "))
14 | # Ensure the length is a positive number
15 | if password_length <= 0:
16 | raise ValueError("The length must be a positive number.")
17 | except ValueError as e:
18 | print("Invalid input:", e)
19 | else:
20 | # Generate and display the password
21 | print("Generated password:", generate_password(password_length))
22 |
--------------------------------------------------------------------------------
/triangle.py:
--------------------------------------------------------------------------------
1 | #lex_auth_012693802383794176153
2 | #Write a python function to check whether three given numbers can form the sides of a triangle.
3 | #Hint: Three numbers can be the sides of a triangle if none of the numbers are greater than or equal
4 | #to the sum of the other two numbers.
5 | def form_triangle(num1,num2,num3):
6 | #Do not change the messages provided below
7 | success="Triangle can be formed"
8 | failure="Triangle can't be formed"
9 |
10 | #Write your logic here
11 | if(num1+num2>num3) and (num2+num3>num1) and (num3+num1>num2):
12 | return success
13 | else:
14 | return failure
15 |
16 | #Use the following messages to return the result wherever necessary
17 |
18 |
19 | #Provide different values for the variables, num1, num2, num3 and test your program
20 | num1=3
21 | num2=3
22 | num3=5
23 | form_triangle(num1, num2, num3)
24 |
--------------------------------------------------------------------------------