×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

## IT 210

by: Ahmed Notetaker

7

0

3

# IT 210 210

Ahmed Notetaker
Minnesota State University, Mankato
GPA 3.1

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

monday week 3
COURSE
Fundamentals of Programming
PROF.
Salivia, Guarionex
TYPE
Class Notes
PAGES
3
WORDS
CONCEPTS
information technology
KARMA
25 ?

## Popular in Information technology

This 3 page Class Notes was uploaded by Ahmed Notetaker on Thursday September 22, 2016. The Class Notes belongs to 210 at Minnesota State University - Mankato taught by Salivia, Guarionex in Fall 2016. Since its upload, it has received 7 views. For similar materials see Fundamentals of Programming in Information technology at Minnesota State University - Mankato.

×

## Reviews for IT 210

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/22/16
WEEK 3 (MONDAY) IT 210 #String ­ immutable, ordered collection myName = "Guarionex Salivia" #Iterate over a string #for i in myName: #    print(i) #Find the total number of characters print(len(myName)) #Find specific elements in the string #First letter print(myName[0]) #Last letter print(myName[­1]) #Realize different indexing schemes in Python print(myName[­1] == myName[len(myName) ­ 1]) print(myName[4] != myName[6])  # != means not equal #Produce a string that is made up every other letter on myString newString = '' for i in range(0, len(myName), 2):     newString += myName[i] print(newString) #Slicing x = "Hello World" y = x[0:5] print(y) print(len(y)) z = x[:6:2] print(z) #Alt: Produce a string that is comprised of every other character in it #Use myName as the input string everyOtherChar = myName[:len(myName):2] print(everyOtherChar) #Print your last name only using slicing print(myName[10:]) #Print your name in reverse print(myName[::­1]) #Print all prefix substrings from your name substring = '' for i in range(0, len(myName)):     substring += myName[i]     print(substring) #Print all substring from name backwards for i in range(1, len(myName) + 1):     print(myName[len(myName) ­ i: len(myName) + 1]) print(hex(ord("A"))) print(hex(ord("a"))) print("Hello" > "hello") #String functions to format or 'manipulate' a string newName = myName.replace('Salivia', 'Jordan') print(newName) print(myName) #center name in 40 spaces newName = "_" + myName.center(40) + "_" print(newName) newName = "_" + myName.rjust(40).lower() + "_" print(newName) newString = "Mississippi" * 13 print(newString) countS = newString.count('s') print(countS) #Encryption #Scramble to Encrypt a message myPlainText = "Python is fun." def scramble2Encrypt(plainText):     evens = ''     odds = ''     for i in range(len(plainText)):         if i % 2 == 0:             evens += plainText[i]         else:             odds += plainText[i]     return evens + odds cipherText = scramble2Encrypt(myPlainText) print(cipherText) def scramble2EncryptV2(plainText):     encrypted1 = ''     encrypted2 = ''     flag = True     for char in plainText:         if flag:             encrypted1 += char             flag = False         else:             encrypted2 += char             flag = True     return encrypted1 + encrypted2 cipherText = scramble2EncryptV2(myPlainText) print(cipherText)

×

×

### BOOM! Enjoy Your Free Notes!

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Jennifer McGill UCSF Med School

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over \$500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Jim McGreen Ohio University

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com