Professional Documents
Culture Documents
Python For Oil and Gas: Website - Linkedin - Youtube - Lenght Function
Python For Oil and Gas: Website - Linkedin - Youtube - Lenght Function
Website - https://petroleumfromscratchin.wordpress.com/
LinkedIn - https://www.linkedin.com/company/petroleum-from-scratch
YouTube - https://www.youtube.com/channel/UC_lT10npISN5V32HDLAklsw
lenght function
sub = 'Production'
len(sub)
10
/
1/30/2021 Python for O&G Lecture 11 - Methods in Strings Part 1 - Colaboratory
len(sub_2)
12
lower method
var.lower()
print(var)
/
1/30/2021 Python for O&G Lecture 11 - Methods in Strings Part 1 - Colaboratory
Upper method
var.upper()
title method
var.title()
count method
var.count('r')
var.count('R')
var.count('m')
Assignment 6
# Ask computer for two inputs in a single line. First input be any number in words, second input be same number in numerics
# Both the inputs is to be separated by character ,
#print the length of that word
# print that word in all capital letters using a method
# print the count of any character in this word
# Print the data type of numerical value input by the user and then convert the datatype to a float type
/
1/30/2021 Python for O&G Lecture 11 - Methods in Strings Part 1 - Colaboratory