Skip to content

Instantly share code, notes, and snippets.

View PramodDutta's full-sized avatar
🎯
Focusing

Promode PramodDutta

🎯
Focusing
View GitHub Profile
@PramodDutta
PramodDutta / Lab079.java
Created April 23, 2024 02:29
Problem with the Java pROGRAM
package src.ex_23042024;
import java.util.Scanner;
public class Lab079 {
public static void main(String[] args) {
//✅ Triangle Classifier:
//

String slicing - TheTestingAcademy

String slicing in Python allows you to extract a part (substring) of a string by specifying a start and end index, and optionally a step. This feature is very versatile and can be used for various purposes, such as extracting substrings, reversing strings, and more. Here's an overview of how string slicing works, including the syntax and some examples:

Syntax

The basic syntax for string slicing is:

string[start:stop:step]

Strings Functions Explained - TheTestingAcademy

Python strings come with a variety of built-in methods that allow you to perform different operations on them. Here's a list of all common string methods available in Python, along with examples for each. This list is not exhaustive but covers the most frequently used methods.

1. capitalize()

  • Description: Converts the first character of the string to uppercase.
  • Example:
s = 'hello world'
print(s.capitalize())  # Output: 'Hello world'
import os
import re
from flask import Flask, request, render_template
from openai import OpenAI
app = Flask(__name__)
@app.route('/analyze', methods=['GET'])
@PramodDutta
PramodDutta / test_create_token.py
Created December 9, 2023 12:10
test_create_token.py
import pytest
import requests
@pytest.mark.token
def test_post_create_token():
payload = {
"username": "admin",
"password": "password123"
}
@PramodDutta
PramodDutta / Top Websites for Practicing Python.md
Created December 7, 2023 05:59
Top Websites for Practicing Python

Based on the information gathered from various sources, here's a table outlining the top websites for practicing and learning Python, including their names, descriptions, and links:

Name Description Link
DataCamp A MOOC platform focusing on data-related subjects, including over 150 interactive Python courses and 250 tutorials, ranging from beginner to advanced levels.
@PramodDutta
PramodDutta / Websites for Practicing SQL.md
Created December 7, 2023 05:56
Websites for Practicing SQL

Sure, I'll compile the information into a table for easy reference:

Name Description Link
LearnSQL.com Blog Articles on SQL-related topics, industry reports, tips, and news. LearnSQL.com Blog
SQLPad Centralized platform for learning SQL with categorized topics and interview questions from top companies. [SQLPad](https://sql
@PramodDutta
PramodDutta / Remote Jobs Websites.md
Created December 7, 2023 05:46
Remote Jobs Websites
  1. We Work Remotely
  2. Remote.co
  3. Flexjobs
  4. Working Nomads
  5. Remotive
  6. Jobspresso
  7. WFH.io
  8. Dribbble
  9. Freelancer.com
  10. Remoters.net
@PramodDutta
PramodDutta / WebTablesTest.JAVA
Created November 19, 2023 04:40
Solution to the HR Module Web Tables
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class WebTablesTest {
@PramodDutta
PramodDutta / Page Object Model and Page Factory.md
Created August 16, 2023 11:40
Page Object Model and Page Factory

Page Object Model and Page Factory

Feature Page Object Model Page Factory
Definition Design pattern to create object repository for web UI elements Extension of Page Object Model that uses @FindBy annotation
Object Repository Objects for each web page stored in separate class Object repository created in the same class
Locating elements FindElement or FindElements used to locate elements @FindBy annotation used to locate elements
Example public class LoginPage{<br>WebElement username = driver.findElement(By.id("username"));<br>WebElement password = driver.findElement(By.id("password"));} public class LoginPage{<br>@FindBy(id = "username") WebElement username;<br>@FindBy(id = "password") WebElement password;}
Initialization No need for initialization Requires initialization using PageFactory.initElements()
Usage LoginPage login = new LoginPage();<br>login.username.sendKeys("name"); ```LoginPage login = PageFactory.initElements(