I hereby claim:
- I am scylladev on github.
- I am scylladev (https://keybase.io/scylladev) on keybase.
- I have a public key ASCCRbnuOIWoCRXBwVr3b58zJtAp4MUu8pnfijZw4eZuHwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Two words are anagrams if they contain all of the same letters, but in a different order. | |
txt1 = input("Enter a string: ") | |
txt2 = input("Enter another string: ") | |
counts = 0 | |
for i in txt2: | |
if i in txt1: | |
counts += 1 | |
else: |
'''SoloLearn: You are given a DataFrame that includes the names and ranks of people. | |
You need to take a rank as input and output the corresponding name column from the DataFrame as a Series. | |
''' | |
'''Note that the rank is an integer, so you need to convert the user input to an integer.''' | |
import pandas as pd | |
data = { | |
'name': ['James', 'Billy', 'Bob', 'Amy', 'Tom', 'Harry'], | |
'rank': [4, 1, 3, 5, 2, 6] |
# The program then displays all the values except 0 from the smallest to the largest, with each integer appearing on different lines. | |
nums_list = [] | |
while True: | |
num = int(input("Enter an integer: ") | |
if num == 0: | |
break | |
else: | |
nums_list.append(num) |
# A string is a palindrome if it is identical forward and backward. | |
palindrome = input("Enter a string: ") | |
reversed_text = "" | |
for i in range(-1, -(len(palindrome) + 1), -1): | |
reversed_text = reversed_text + palindrome[i] | |
if palindrome == reversed_text: | |
print(palindrome, "is a palindrome") |
# using recursion | |
def factorial(x): | |
if x == 1: | |
return 1 | |
else: | |
return x * factorial(x - 1) |
given_year = 2044 | |
if (given_year % 4 == 0) and (given_year % 100 != 0): | |
print("It is a leap year") | |
elif (given_year % 100 == 0) and (given_year % 400 == 0): | |
print("It is a leap year") | |
else: | |
print("It is not a leap year") |
import numpy as np | |
n, p = [int(x) for x in input().split()] | |
i = 0 | |
list_arr = [] | |
# appends empty lists(rows) for the 2d array to list_arr | |
# and then appends the values from each line of input into the individual lists in the list |