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
strchar = [] | |
intchar = [] | |
inpt = input("Input: ") | |
inpt = list(inpt) | |
for i in range(0, len(inpt)): | |
if inpt[i].isalpha(): | |
strchar.append(inpt[i]) | |
elif inpt[i].isdigit(): |
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
for x in range(0,7): | |
if x == 3 or x == 6: | |
continue | |
print(x) |
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
count_odd = 0 | |
count_even = 0 | |
numbers = [1,2,3,4,5,6,7,8,9,10] | |
x = 0 | |
for x in numbers: | |
if x % 2 == False: | |
count_odd = count_odd + 1 |
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
import sys | |
import random | |
randint = random.randint(1, 9) | |
x = int(input("What is your first guess between 1 to 9: ")) | |
if x == randint: | |
print("Correct!") |
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
nl = [] | |
for x in range(1500, 2701): | |
if (x%7==0) and (x%5==0) == True: | |
nl.append(x) | |
print(nl) |
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
from googletrans import Translator | |
import sys | |
import codecs | |
import os.path | |
translator = Translator() | |
language = str(input("Language code: ")) | |
file_Exist = str(input("Filename: ")) |
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
import os.path | |
import sys | |
read_or_write = str(input("Read or Write? (read/write)")) | |
exist_or_not = 0 | |
if read_or_write == "read": | |
which_one = str(input("Which file would you like to read?")) | |
exist_or_not = os.path.exists(which_one) |
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
answer = input("Do you want to subtract or add:") | |
def add_numbers(): | |
first_number = int(input("What would be your first number to add? ")) | |
second_number = int(input("What would be your second number to add? ")) | |
total = first_number + second_number | |
print(total) | |
def subtract_numbers(): | |
first_number = int(input("What would be your first number to subtract? ")) |
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
people = [ | |
"A", | |
"B", | |
"C", | |
"D", | |
"E", | |
] | |
odd_people = [] | |
even_people = [] |
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
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
num = int(input("Choose a number from 1 to 10: ")) | |
new_list = [] | |
for i in x: | |
if i < num: | |
new_list.append(i) | |
print(new_list) |
NewerOlder