Sarah111-AHM / Semsmah

2 stars 0 forks source link

Master python #53

Open Sarah111-AHM opened 11 months ago

Sarah111-AHM commented 11 months ago

Day 01 Introduction and target setting Learn Python and set up the development environment. Sources • Official Python Documentation: https://www.python.org/doc/ ⚫ Codecademy Python Course: https://www.codecademy.com/learn/learn-python-3 Example Questions Q1: Write a Python program for printing Hello World!" Q2: Calculate the sum of two numbers entered by the user. Q3: Convert temperature from Celsius to Fahrenheit

Practice Questions 1. Write a Python program to calculate the area of ​​a rectangle given its length and width. 2. Create a program that takes the user's name and age as input and prints a welcome message. 3. Write a program to check whether a number is even or odd. 4. Given a list of numbers, find the maximum and minimum values. 5. Create a Python function to check if a given string is a palindrome. 6. Calculate compound interest for a given principal amount, interest rate, and time period. 7. Write a program that converts a given number of days into years, weeks, and days. 8. Given a list of integers, find the sum of all positive numbers. 9. Create a program that takes a sentence as input and counts the number of words in it. 10. Executing a program that exchanges the values ​​of two variables.

Today's variables and data types Objective Understand the different variables and data types in Python. Resources • W3Schools Python Variables: https://www.w3schools.com/python/python_variables.asp • Real Python data types: https://realpython.com/python-data-types/ Sample Questions Q1: Create variables to store a file The person's name, age, and average test scores. Q2: Connect two strings and print the result. Q3: Create a list of fruits and access items using indexing.

Practice Questions 1. From the list of numbers, find the sum and mean. 2. Create a program that takes a temperature in Celsius and converts it to Kelvin. 3. Execute a program that checks if a given text string matches. 4. Create a function to reverse a given string. 5. Given a list of names, connect them into one string separated by spaces. 6. Write a Python program to check if a given string is pangram (containing all letters of the alphabet). 7. Calculate the area and circumference of a circle given its radius. 8. Execute a program that converts a certain number of minutes into hours and minutes. 9. Create a function to count the number of vowels in a given string. 10. Write a program to check if a number is prime

DAY CONTROL FLOW AND LOOPS Target Learn about conditional statements and loops in Python. Resources • W3Schools Python Conditions: https://www.w3schools.com/python/python_conditions.asp • Real Python Python Loops: https://realpython.com/python-for-loop/ Example Questions Q1: Write a program that checks if A particular number is positive, negative, or zero. Q2: Create a loop that prints the first 10 even numbers. Q3: Execute a program that finds the largest number in a list..

Practice Questions 1. Create a program that takes a year as input and checks whether it is a leap year. 2. Given a list of integers, find all the even numbers and store them in a new list. 3. Write a Python program to check whether the given number is a prime number. 4. Create a program that generates a Fibonacci sequence up to a certain number of terms. 5. Given a list of names, print all the names beginning with the letter A. 6. Execute a program that prints the multiplication table for a specific number. 7. Write a program that calculates the factorial of a given number. 8. Create a loop that prints all prime numbers between 1 and 50. 9. Given a list of words, count the number of words with more than five letters. 10. Calculate the sum of the digits of a given number.

Today's functions aim to understand functions and how they are defined and called. Resources W3Schools Python Functions: https://www.w3schools.com/python/python_functions.asp • Defining Real Python Functions: https://realpython.com/defining-your-own-python-function/ Example Questions Q1: Write a Function to calculate the area of ​​a circle given its radius. Q2: Create a function to check if a number is prime. Q3: Implementation of a function that reflects a specific string

Practice Questions 1. From the list of numbers, construct a function to find the sum of all positive numbers. 2. Write a Python function to check if a given string is a palindrome. 3. Implement a function that returns the modulus of a given number using recursion. 4. Create a function to find the square of each item in a given list. 5. Write a function to check if a number is even or odd and return 'even' or 'odd' accordingly. 6. Calculate the area of ​​a triangle given its base and height using a function. 7. Create a function that takes a list of strings and returns the list in alphabetical order. 8. Write a function that takes two lists and returns their intersection (common elements). 9. Implement a function to check whether a given year is a leap year or not. 10. Create a function that takes a number as input and prints its multiplication table.

Day 05 Manipulating Strings Objective Identify and format common string operations. Resources ⚫ W3Schools Python Strings: https://www.w3schools.com/python/python_strings.asp Real Python Python String Formatting: https://realpython.com/python-string-formatting/ Question Examples Q1: Create a program that checks if Certain series are symmetrical. Q2: Write a function to count the number of vowels in a given string. Q3: Write a function to count the number of vowels in a given string.

Questions for practice 1. Give a list of words, connect them into one string separated by spaces. 2. Create a function to reverse a given string. 3. Write a program that takes a sentence as input and counts the number of words in it. 4. Implement a function that checks if a given string is pangram (containing all letters of the alphabet). 5. Given a string, write a function to remove all vowels from it and return the modified string. 6. Write a Python program to find the length of the longest word in a sentence. 7. Create a function that takes a sentence as input and returns the sentence in reverse order. 8. Given a list of nouns, count the number of nouns that begin with a vowel. 9. Write a function to remove all duplicate characters from a given string. 10. Execute a program that takes a sentence and a word as input and checks whether the word is present in the sentence

Day 06 Lists and Lists Objective Understand Lists and Collections in Python and their operations. Resources ⚫ W3Schools Python lists: https://www.w3schools.com/python/python_lists.asp • Real Python lists and tuples: https://realpython.com/python-list-tuples/ Example questions Q1: Given a list of numbers Find the sum and average using the built-in functions. Q2: Create a list of fruits and add a new fruit to the list. Q3: Accessing items in a collection using indexing

Exercise questions 1. Given two lists of numbers, group them into one list. 2. Write a program that finds the largest and smallest items in a list. 3. Implement a function that takes a list of numbers and returns a new list of squared values. 4. Create a program that finds the common elements between two lists and stores them in a new list. 5. Given the list of words, find the word with the maximum length and its length. 6. Write a Python program to count the occurrences of each element in a given list. 7. Given a list of names, remove all duplicate names and print unique ones. 8. Create a function that takes a list of strings and returns the list ordered by the length of the strings. 9. Write a program that checks whether a given list is in ascending order. 10. Implementation of a function that takes two lists and rejoins them (all unique elements from both lists).

Day 07 Dictionaries and Collections Objective Understand dictionaries and collections in the Python language and their operations. Resources • W3Schools Python dictionaries: https://www.w3schools.com/python/python_dictionaries.asp • Real Python dictionaries and collections: https://realpython.com/python-dicts/ Sample Questions Q1: Create a dictionary to store information about a person (Name, age and address). Q2: Add a new key-value pair to an existing dictionary. Q3: Create a combination of unique numbers from the list of numbers

Exercise questions 1. Give two dictionaries, combine them into one. 2. Write a program that finds the most common item in the list. 3. Execute a function that removes the key-value pair from the dictionary. 4. Create a program that checks if two sets contain any common elements.. 5. Given a list of dictionaries, find the dictionary with the highest value for a given key. 6. Write a Python program that counts the number of occurrences of each character in a given string using a dictionary. 7. Given two sets, find the union, intersection and difference between them. 8. Create a function that takes a list of dictionaries and sorts them based on a specified key. 9. Write a program that finds the average value of all items in a dictionary list. 10. Implement a function that takes a list of strings and returns an array of unique characters found in all strings