Engineering 102 Exams 1 & 2 - TAMU – Ijaz 100% Correct
Engineering 102 Exams 1 & 2 - TAMU – Ijaz 100% Correct Turn mystr = "string1 string2 string3" into a list mystr = (" ") Turn mystr = "1234" into a list mystr = list(mystr) bool("any string") True format the float var to have x decimal places and print it print('{:.xf}'.format(var)) loop the dictionary my_dict for key, value in my_(): How to input two variable at a time (x and y) x, y = input("...").split() loop through the values in my_dict for value in my_s(): loop through the keys in my_dict for key in my_(): (x) will... add x-len(string) amount of spaces to the right the string (x) will... add x-len(string) amount of spaces to the left the string b will delete the last character of the string t will print it tabbed use the find function find the index of x in mystr (x) import math module from math import * import pi define a function called myfun def myfun(): call a funtion called myfun myfun() put ==, and, or, & not in order of operations ==, not, and, or bool() False bool(0) False bool(1) True 2 things that will make the code stop running exit() and quit() True or False: you can add lists like newList = smallList1 + smallList2 True adds something to the end of a list (list) d() in a list, what will insert x to make it index i t(i, x) True or False: list[y] = x Will change whatever is in index y to x True how to delete index i from list del list[i] will delete
Written for
- Institution
- Engineering 102
- Course
- Engineering 102
Document information
- Uploaded on
- December 17, 2023
- Number of pages
- 16
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
engineering 102 exams 1 2 tamu ijaz 100 cor
Also available in package deal