EC Lecture Notes - Lecture 1: In C, Infinite Loop

7 views2 pages

Document Summary

In c or c++ we use power function for exponentiation but in python we use asterisk symbol for example. Floor division : // gives integral value not float. One of the built-in functions of python is divmod, which takes two arguments and and returns a tuple containing the quotient of. You can use letters, numbers, and underscores in variable names. But you can"t use special symbols, or start the name with a number. Which means, lastname and lastname are two different variable names. Variables can be reassigned as many times as you want. Like this: x = 123. 456 print(x) x = "this is a string" print(x + "!") Can be taken by using input() for text. Assignment operators in c are in place operators in python. These operators aren"t just useful for numbers, oh no, no, no. Simplify away! x = "spam" print(x) x += "eggs" print(x)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents