-
Notifications
You must be signed in to change notification settings - Fork 0
Master #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ParsaSoroush
wants to merge
112
commits into
main
Choose a base branch
from
master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Master #1
Conversation
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
sampleDict = {
class: {
student: {
name: Mike,
marks: {
physics: 70,
history: 80
}
}
}
}
Expected output:
80
'Physics': 82, 'Math': 65, 'history': 75 } Expected output: Math
…m 20. Given: list1 = [5, 20, 15, 20, 25, 50, 20] Expected output: [5, 15, 25, 50]
…a dictionary in a way that item from list1 is the key and item from list2 is the value
…is required to check if the given value is present. Write a Python program to check if value 200 exists in the following dictionary.
…h sets by removing duplicates.
… with items that exist only in the first set and not in the second set.
… display each variable.
…) of a list inside a following tuple to 222
…e, inserts sample data, and reads the data in a specific order. It uses the mysql.connector module to interact with the MySQL server. The code creates a connection, cursor, and database, then creates a table named employees with columns for Name, Height, and Weight. It inserts four sample employees and commits the changes. The code then reads the data in descending order of height and ascending order of weight, and prints each employee's data. Finally, it closes the cursor and connection.
…le to select a random color from a list of 15 colors. The color_guess function chooses a random color and asks the user to guess it. The user's guess is compared to the chosen color, and if it's incorrect, the user is asked to try again. This continues until the user guesses the correct color, at which point a congratulatory message is printed. The game continues to prompt the user for input until the correct color is guessed. The color_guess function is then called to start the game.
…addresses) and passwords in a SQLite database. It uses regular expressions to validate email and password formats. The code creates a users table with username and password columns. It then enters an infinite loop, prompting the user to enter their email and password. The validate_email and validate_password functions check the input formats, and if valid, the store_credentials function inserts the data into the database. If the inputs are invalid, the user is prompted to try again.
… regular expressions. It defines a function check_email that takes an email as input, checks if it matches the pattern, and returns OK if it does or WRONG if it doesn't. The pattern allows for letters, numbers, and special characters in the local part, followed by @, then letters, numbers, and - in the domain, and finally a period and letters, numbers, and - or . in the top-level domain. The user is prompted to input their email, and the result is printed in uppercase.
…re the country data. We send a GET request to the website and parse the HTML content using BeautifulSoup. We find all country rows by searching for tr elements. We extract the country data from each row by searching for td elements. We store the country data in the database using SQL queries. Finally, we commit the changes and close the connection.
3a12f32 to
72b1fdb
Compare
…an error if wasent print: the blog {id} found
…ons for writing clean, readable, and consistent Python code. Following coding conventions is essential for maintaining code quality, facilitating collaboration, and making it easier for others (and your future self) to understand and work with your code. The most widely accepted and followed coding convention in Python is known as PEP 8 (Python Enhancement Proposal 8).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
master