extragulp-blog
extragulp-blog
Extragulp
15 posts
Coding and Networking
Don't wanna be here? Send us removal request.
extragulp-blog · 6 years ago
Text
FreeCodeCamp - Basic HTML - Placeholder Text
Tumblr media
Web developers traditionally use lorem ipsum text as placeholder text. The 'lorem ipsum' text is randomly scraped from a famous passage by Cicero of Ancient Rome. Lorem ipsum text has been used as placeholder text by typesetters since the 16th century, and this tradition continues on the web. Well, 5 centuries is long enough. Since we're building a CatPhotoApp, let's use something called kitty ipsum text. Replace the text inside your p element with the first few words of this kitty ipsum text: Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. SOLUTION:
Hello World
CatPhotoApp
Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Read the full article
0 notes
extragulp-blog · 6 years ago
Text
FreeCodeCamp - Basic HTML - Paragraph Element
Tumblr media
p elements are the preferred element for paragraph text on websites. p is short for "paragraph". You can create a paragraph element like this: I'm a p tag! Create a p element below your h2 element, and give it the text "Hello Paragraph". SOLUTION:
Hello World
CatPhotoApp
Hello Paragraph Read the full article
0 notes
extragulp-blog · 6 years ago
Text
FreeCodeCamp - Basic HTML - h2 element
Tumblr media
The h2 element you will be adding in this step will add a level two heading to the web page. This element tells the browser about the structure of your website. h1 elements are often used for main headings, while h2 elements are generally used for subheadings. There are also h3, h4, h5 and h6 elements to indicate different levels of subheadings. Add an h2 tag that says "CatPhotoApp" to create a second HTML element below your "Hello World" h1 element. SOLUTION:
Hello World
CatPhotoApp
Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Python – PSET 1 Problem 3
Tumblr media
Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print Longest substring in alphabetical order is: beggh In the case of ties, print the first substring. For example, if s = 'abcbcd', then your program should print Longest substring in alphabetical order is: abc SOLUTION: i = 0 curr = "" long = "" for i in range(len(s)): if (s >= s): curr += s else: curr = s if len(curr) > len(long): long = curr print("Longest substring in alphabetical order is: " + str(long)) Read the full article
0 notes
extragulp-blog · 6 years ago
Text
FreeCodeCamp - Basic Html
Tumblr media
First, you'll start by building a simple web page using HTML. You can edit code in your code editor, which is embedded into this web page. Do you see the code in your code editor that says
Hello
? That's an HTML element. Most HTML elements have an opening tag and a closing tag. Opening tags look like this:
Closing tags look like this:
The only difference between opening and closing tags is the forward slash after the opening bracket of a closing tag. Each challenge has tests you can run at any time by clicking the "Run tests" button. When you pass all tests, you'll be prompted to submit your solution and go to the next coding challenge. To pass the test on this challenge, change your h1 element's text to say "Hello World". SOLUTION:
Hello World
Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Python – PSET 1 Problem 2
Tumblr media
Assume s is a string of lower case characters. Write a program that prints the number of times the string 'bob' occurs in s. For example, if s = 'azcbobobegghakl', then your program should print: Number of times bob occurs is: 2 SOLUTION: numBob = 0 i = 0 for i in range(len(s)): if (s == 'bob'): numBob +=1 print("Number of times bob occurs is: " + str(numBob)) Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Python - PSET 1 Problem 1
Assume s is a string of lower case characters. Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o', and 'u'. For example, if s = 'azcbobobegghakl', your program should print: Number of vowels: 5 SOLUTION: numVowels = 0 numCons = 0 for char in s: if char == "a" or char == "e" or char == "i" or char == "o" or char == "u": numVowels += 1 print("Number of vowels: " + str(numVowels)) Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise Python: For....
Tumblr media
In this problem you'll be given a chance to practice writing some for loops. 1. Convert the following code into code that uses a for loop. prints 2 prints 4 prints 6 prints 8 prints 10 prints Goodbye! x = 2 i = 1 for i in range(5): print(x) x += 2 print("Goodbye!") Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise 3 Python: While loops
Tumblr media
Write a while loop that sums the values 1 through end, inclusive. end is a variable that we define for you. So, for example, if we define end to be 6, your code should print out the result: 21 which is 1 + 2 + 3 + 4 + 5 + 6. x = 0 sum_x = 0 while x Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise 2 Python: while loop
Convert the following into code that uses a while loop. prints Hello! prints 10 prints 8 prints 6 prints 4 prints 2 x = 10 print("Hello!") while x >= 2: print(x) x -= 2 Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise: while loop
Tumblr media
In this problem you'll be given a chance to practice writing some while loops. 1. Convert the following into code that uses a while loop. print 2 prints 4 prints 6 prints 8 prints 10 prints Goodbye! x = 2 while x Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise Python: varA and varB
Assume that two variables, varA and varB, are assigned values, either numbers or strings. Write a piece of Python code that evaluates varA and varB, and then prints out one of the following messages: "string involved" if either varA or varB are strings"bigger" if varA is larger than varB"equal" if varA is equal to varB"smaller" if varA is smaller than varB if type(varA) == str or type(varB) == str: print('string involved') elif varA > varB: print('bigger') elif varA == varB: print('equal') elif varA < varB: print('smaller') Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Excercise 3 MIT 6.00.1x - Core Elements of Programming
if 6 > 7: print("Yep") answer: blank if 6 > 7: print("Yep") else: print("Nope") answer: Nope var = 'Panda' if var == "panda": print("Cute!") elif var == "Panda": print("Regal!") else: print("Ugly...") answer: Regal! temp = 120 if temp > 85: print("Hot") elif temp > 100: print("REALLY HOT!") elif temp > 60: print("Comfortable") else: print("Cold") answer: Hot temp = 50 if temp > 85: print("Hot") elif temp > 100: print("REALLY HOT!") elif temp > 60: print("Comfortable") else: print("Cold") answer: Cold Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Exercise: happy
Tumblr media
Write a piece of Python code that prints out the string 'hello world' if the value of an integer variable, happy, is strictly greater than 2. if happy>2: print('hello world') Read the full article
0 notes
extragulp-blog · 6 years ago
Text
Start Python Journey
Downloading the Python Installer
To download the free “Anaconda” Python distribution created by Continuum Analytics: Visit the download page for Continuum Analytics. NOTE: the installer we’ll be downloading and installing is larger than the average file, because it contains Python, associated packages, a code editor, and some other toys. It may take 15-20 minutes in total to download and install when executing the commands. You will be downloading the Python 3 version (any version 3.5 or later is good). If you download Python 2.7, your code may be incorrect to our graders.
Installing Python and Spyder
To install Python after downloading the graphical installer, double click the .exe (Windows) or .pkg (Mac) file and follow the instructions on the screen. There are some additional notes and comments on installing/uninstalling Python on Continuum’s website here.Note that Continuum’s Python distribution should (per their quick start guide) install cleanly into a single directory, should not require Administrator or root privileges, and should not affect other Python installs on your system (if you have any), or interfere with OSX Frameworks. Let us know in the forum if you’re having any issues, so that others can learn along with you.When installing Anaconda, a pop-up menu may ask whether or not to “Add Anaconda to my PATH environment variable”, and “Register Anaconda as my default Python 3.5.” The installation will take about 15 minutes. Click Finish to close the window when done.
Starting Spyder, a code editor
When you download and install the Anaconda distribution of Python, you are getting several tools related to Python development. One of the tools is Spyder (Scientific Python Development Environment), an integrated development environment useful for writing, running, and debugging code. Open Anaconda Navigator Click the blue “Launch” button by “spyder” to launch Spyder. It should take a moment to load and may appear to pause for a minute or two.
Spyder Application Overview
Opening the Spyder application should present you with the following window (screenshot is from Mac OS X, but are similar in Windows and Linux). This window contains two commonly used parts, among others: Code Editor that lets you create and edit existing Python source files IPython interpreter pane, which gives you access to the Python interactive mode
Tumblr media
Read the full article
1 note · View note