Skip to content

Instantly share code, notes, and snippets.

scugn1zz0

  • Naples, Italy
Block or report user

Report or block scugn1zz0

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 05ListOverlap.py
# and write a program that returns a list that contains only the elements that are common between the
# lists (without duplicates). Make sure your program works on two lists of different sizes.
# exercise from http://www.practicepython.org/exercise/2014/03/05/05-list-overlap.html
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
c = []
# Create list c
for num in a:
@scugn1zz0
scugn1zz0 / ipAddressForLoops.py
Last active Dec 28, 2016
Check if an IP address is entered correctly [no expression, only if, else, for ecc.]
View ipAddressForLoops.py
# ipAddress = input("please enter an ipAddress: ")
ipAddress = "192.168.7.7"
# check if number of dots is 3
numberOfDot = 0
for char in ipAddress:
if char == '.':
numberOfDot += 1
totNumbOfDot = numberOfDot # output of this section is totNumberOfDot, to be checked at the end
View 06StringList.py
txtInput = str(input("please enter a palindrome: "))
reversedInput = txtInput[::-1]
if reversedInput == txtInput:
print("good job")
else:
print("you missed it")
You can’t perform that action at this time.